Undoing a commit and "failed to push some refs to .." error
UPDATE: This article has been updated as per comments from Alexey Borzenkov
I committed a changeset and pushed the change to github. Now I want to revert the changes in such a way that log has no trace of it.
If you want to undo the last commit in git and still keep the changes as part of that commit in your working directory then
git reset --soft HEAD^
However after committing this change if you try to push the changes to github you might get error like this
failed to push some refs to ...
The fix is to do git push with force option.
git push -f