Is there any way to undo the effects of "git revert head"?

blueberryfields picture blueberryfields · Sep 7, 2010 · Viewed 56.1k times · Source

I've accidentally run the command against the wrong branch in my repository - is there a way to undo this change?

Answer

Roman Cheplyaka picture Roman Cheplyaka · Sep 7, 2010

git revert just creates a new commit -- you can "remove" it with git reset --hard HEAD^ (be more careful with it, though!)