Skip to content

Instantly share code, notes, and snippets.

@rollxx
Created September 18, 2012 08:58
Show Gist options
  • Save rollxx/3742132 to your computer and use it in GitHub Desktop.
Save rollxx/3742132 to your computer and use it in GitHub Desktop.
git reset to hash
# 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