git reflog
SafeHEAD history (lifesaver)
git reflog
Every HEAD move is recorded — recover 'lost' commits after reset --hard or a bad rebase.
Examples
git reflogFind a lost commitgit reset --hard HEAD@{2}Restore an earlier state
Syntax
git reflog [show] [branch]
Before you run it
Viewing is safe; recover with care.
Used when you see
Broke history with reset/rebase
1
See the whole flow →Find the pre-disaster commit in reflogHEAD@{n} addresses any prior state directly.
The same reference, with no signal at all
Every command and flow from this site, held on your device and searchable with no connection. Free to install, no ads.
Get it free on the App Store