• git keeps a record of when the tips of branches and other references were updated in the repo.
  • You can check the log of HEAD —> go to .git folder and move to logs. In logs you will find HEAD
  • git only keeps reflogs on your local activity. They are not shared with collaborators.
  • Reflogs also expire. Git cleans out old entries after around 90 days, though this can be configured.
  • git reflog accepts show, expire, delete and exists.
  • show is the only commonly used variant and it is default sub command.
  • git reflog show HEAD or git reflog show HEAD@{10} shows the logs.
  • Time Based Reflog:
    • git reflog master @{one.week.ago}
    • git checkout bugfix@{2.days.ago} or yesterday or 3.minutes.ago