...

/

Undo a Hard Reset with the git reflog Command

Undo a Hard Reset with the git reflog Command

Learn to recover the changes and commits in case of a hard reset.

The git reflog command

We can undo a hard reset with the git reflog command.

After we do a hard reset, we can’t see the changes of that commit in the git log or working directory anymore. But still, we can use reflog to rescue recently deleted commits.

We’ve run these commands in the terminal below to see ...