If you are ahead of master, to reset and save your changes.
git reset --soft HEAD~ # reset to the last commit
git stash # stash all the changes in the working tree
git push # push changes
git stash pop # get your changes back