Search code examples
gitundorevert

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


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


Solution

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