Skip to content

Instantly share code, notes, and snippets.

@felipekm
Created June 11, 2018 19:06
Show Gist options
  • Save felipekm/f26b446f94015d67f41c3f7e43cb280b to your computer and use it in GitHub Desktop.
Save felipekm/f26b446f94015d67f41c3f7e43cb280b to your computer and use it in GitHub Desktop.
Git - revert to specific commit
# Resets index to former commit; replace '56e05fced' with your commit code
git reset 56e05fced
# Moves pointer back to previous HEAD
git reset --soft HEAD@{1}
git commit -m "Revert to 56e05fced"
# Updates working copy to reflect the new commit
git reset --hard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment