git reflog show HEAD@{5}

Category: Git - Advanced

git reflog show HEAD@{5}

Inspect the reflog five steps back

Shows the state of HEAD five moves ago, complete with the hash and what changed. Combined with git reset --hard HEAD@{5} it restores exactly that point. The reflog is local to your machine and expires after 90 days by default.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.