Skip to content

Instantly share code, notes, and snippets.

@rzani
Last active August 29, 2015 14:19
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 rzani/ab06e44d0e5ffcd3754a to your computer and use it in GitHub Desktop.
Save rzani/ab06e44d0e5ffcd3754a to your computer and use it in GitHub Desktop.
How to remove a commit that is already pushed to Github

Using this is dangerous in a collaborative environment: you're rewriting history

$ git reset --hard <old-commit-id>
$ git push -f origin <branch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment