git reflog

9.3. git reflog#

Displays the git reference log.

It can be used to get the references of previous stages, including those that did not make it into the history.