Skip to content

Instantly share code, notes, and snippets.

@douglas
Created July 8, 2011 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save douglas/1072791 to your computer and use it in GitHub Desktop.
Save douglas/1072791 to your computer and use it in GitHub Desktop.
Remove an unwanted commit on git and github
# force git/github to ignore a unwanted commit and use HEAD^ as HEAD of the repository
$ git push -f origin HEAD^:remote_branch
OR
$ git rebase -i HEAD~2
$ git push origin +master
References:
http://stackoverflow.com/questions/448919/how-can-i-remove-a-commit-on-github
Supreme git magic -----> http://www-cs-students.stanford.edu/~blynn/gitmagic/ch05.html#_8230_and_then_some
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment