Git · History and recovery
git reflog
A local log of where HEAD has been. It is the fastest way to recover commits after a reset.
Syntax
git reflogExample
Example
git reflog
git reset --hard HEAD@{2}More in this group
Learn this in the course
Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.