Introduction
Sometimes you lose track of commits after changes like resets or branch switches. Git reflog helps you find those lost commits by showing a history of where your branches and HEAD have pointed.
When you accidentally reset your branch and want to recover previous commits.
When you switched branches and lost track of recent commits.
When you deleted a branch but want to find commits that were on it.
When you want to see a timeline of all recent changes to HEAD.
When you want to undo a recent commit or reset by finding its reference.