Skip to content

Instantly share code, notes, and snippets.

@moiz-frost
Forked from fuzzmz/gist:4111521
Created August 6, 2018 12:36
Show Gist options
  • Save moiz-frost/5fac8b4c1d2f66108181709032f0a49e to your computer and use it in GitHub Desktop.
Save moiz-frost/5fac8b4c1d2f66108181709032f0a49e to your computer and use it in GitHub Desktop.
git revert to specific commit
git reset 56e05fced #resets index to former commit; replace '56e05fced' with your commit code
git reset --soft HEAD@{1} #moves pointer back to previous HEAD
git commit -m "Revert to 56e05fced"
git reset --hard #updates working copy to reflect the new commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment