if you have not pushed the changes, git revert
is probably not what you want. It makes a new commit that reverses the changes made.
Use git reset --hard <last good commit>
to remove the bad commit. You can address this commit with a HEAD
reference as you did, but that will not adjust the commits in the branch. If you reference the last known good commit with the branch name, such as git reset --hard <branch>~2
to reference 2 commits prior to the current one.