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).
- Check the commit ID before the reset with
git reflog - Revert to the state before the reset with
git reset --hard HEAD@{number}
That’s how to undo a git reset.
