Interview Prep/Git & GitHub/Git internals: objects, refs and the index

What is the reflog and how is it different from `git log`?

IntermediateConceptGit internals: objects, refs and the index
Answer

The reflog is a local, per-ref journal of where a ref pointed over time (checkouts, commits, resets, rebases). git log walks the commit graph from a ref; reflog records movement of the ref itself, so it still lists commits that are no longer reachable. Entries expire after 90 days (30 for unreachable) by default and are never pushed.

git reflog show HEAD
git log -g --oneline
All Git & GitHub questions Roadmap: Git & GitHub

More on Git internals: objects, refs and the index