I know that the compressed version of reflog is stored in .git/packed-refs but where is the actual reflog located and how does git restore history when there is one type of git reflog ?
reflog
.git/packed-refs
git reflog
Reflogs are in .git/logs/<refname> . For example, for a branch named master (e.g. refs/heads/master ) you need .git/logs/refs/heads/master .
.git/logs/<refname>
master
refs/heads/master
.git/logs/refs/heads/master
HEAD , of course, is abnormal and .git/logs/HEAD .
HEAD
.git/logs/HEAD