Git Reflog: Your Local Time Machine

Suman SharmaSuman Sharma

Git Reflog: Your Local Time Machine

Reflog is Git’s local time machine.

It records moves of HEAD, so you can recover after resets, rebases, and other “oh no” moments.

Git reflog as a local recovery timeline

The rescue flow

git reflog
git reset --hard HEAD@{3}

Use the index from before things broke. That’s the whole trick.

Next

For more “I messed up” recipes in plain English:

Contact

Get in Touch

Want to call me? book a call and I'll respond in the available time slot. I will ignore all soliciting.