reflog

Git's local record of every position HEAD and each branch has pointed at, used to find and recover commits that no branch points at any more.

In more detail

Each commit, checkout, reset, rebase and merge adds an entry such as HEAD@{2}. After a bad reset or rebase you can find the old commit ID there and create a branch at it with git branch recovered ID. It is local to your clone and entries expire, by default after about 90 days, or 30 for unreachable commits.

Examples

git reflog
git branch recovered d4e5f6g

Related terms

Taught in

References