I stuck with the same issue. I have found easiest solution which I like to share.
1) Create new branch with your changes.
git checkout -b mybranch
2) (Optional) Push new branch code on remote server.
git push origin mybranch
3) Checkout back to master branch.
git checkout master
4) Reset master branch code with remote server and remove local commit.
git reset --hard origin/master