git reflog

History of HEAD movements

low risk

interactive breakdown — edit the command and press Explain
$ 
What it does

Lets you recover commits lost to resets or rebases.

Examples
git reflogRecent HEAD positions · explain & risk-check →
git reset --hard HEAD@{2}Restore a previous state · explain & risk-check →
Related
git reset
Open the full explainer →More in Git

Reference text is hand-written and may be incomplete — check man git for your version. Test destructive commands on a non-production system first.