11

I know that compressed version of reflog is stored in .git/packed-refs but where is actual reflog is located and how git restores history when one types git reflog ?

TOP KEK
  • 2,593
  • 5
  • 36
  • 62

1 Answers1

9

The reflogs are in .git/logs/<refname>. For example, for a branch named master (eg, refs/heads/master) then you would want .git/logs/refs/heads/master.

HEAD, of course, is anomalous, and is .git/logs/HEAD.

Edward Thomson
  • 74,857
  • 14
  • 158
  • 187