Featured image of post How to undo git reset

How to undo git reset

How to undo git reset

If you accidentally run git reset after making a git commit, here is how to undo the git reset (restore the state at the time of the git commit).

  1. Check the commit ID before the reset with git reflog
  2. Revert to the state before the reset with git reset --hard HEAD@{number}

That’s how to undo a git reset.

comments powered by Disqus