What git-revert does is create a commit which undoes changes made in given commit, creating a commit which is reverse (well, reciprocal) of a given commit. Therefore git revert <SHA-1>
should and does work.
If you want to rewind back to specified commit, and you can do this because this part of history was not yet published, what you need to use is git-reset, not git-revert: git reset --hard <SHA-1>
(note that -hard
would make you loose any not comitted changes in working directory).
By the way, perhaps it is not obvious, but everywhere where documentation says <commit>
or <commit-ish>
(or <object>
) you can put SHA-1 identifier (full or shortened) of commit.