git reflog
git reflog
Risk: Safe
What it does
Shows every place HEAD has been.
When to use it
When commits seem lost after a reset.
Example
$ git reflogFind the lost commit.
$ git reset --hard HEAD@{1}Jump back to where HEAD was one move ago.
Learn it in: Reflog, your safety net · Official docs