I have a commit id of "a9a6de2" within my list of commits that's a few versions old.
What's the git command to revert to that commit?
I have a commit id of "a9a6de2" within my list of commits that's a few versions old.
What's the git command to revert to that commit?
to create a new branch that matches that SHA
git checkout -b YOUR_BRANCH a9a6de2
To make the currently checked out branch match that sha --Not working directory safe --Do not to to push this to a remote server
git reset --hard a9a6de2
Note that git revert
does a subtractive patch of the SHA specified (and only the SHA specified), which doesn't sound at all like what you want. I understand this is a common source of confusion for Subversion users because 'revert' behaves differently in Subversion.
Sounds like you want to revert that commit
$ git revert a9a6de2
should do it