Published on

git reflog vs git log

Authors
  • avatar
    Name
    Gene Zhang
    Twitter

What is git reflog?

https://stackoverflow.com/a/17859891

Usage

git reflog

output:

$ git reflog
c3a414f (HEAD -> main) HEAD@{0}: commit: Update README
a9f5b1d HEAD@{1}: commit: Add new feature
b2c3d4e HEAD@{2}: commit: Fix bug in feature
d4e5f6a HEAD@{3}: commit: Initial commit
git log

output:

$ git log
commit c3a414f (HEAD -> main)
Author: John Doe <john.doe@example.com>
Date:   Thu Mar 13 11:36:02 2025 +0100

    Update README