Skip to content

Instantly share code, notes, and snippets.

@WebDevJL
Last active January 18, 2016 08:55
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 WebDevJL/aeb3f4551e68b7f0eede to your computer and use it in GitHub Desktop.
Save WebDevJL/aeb3f4551e68b7f0eede to your computer and use it in GitHub Desktop.
Git: reset repo to given commit
# Reset the index to the desired tree
git reset 56e05fced
# Move the branch pointer back to the previous HEAD
git reset --soft HEAD@{1}
git commit -m "Revert to 56e05fced"
# Update 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