Git Reflog — Free Git & GitHub Tutorial
Learn Git Reflog in Git & GitHub with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.
TL;DR: Learn Git Reflog in Git & GitHub with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.
Written & reviewed by the Syllab.in Academic Team (CBSE/NCERT subject experts) · Updated
Git Reflog in Git & GitHub
git reflog shows a log of where HEAD has been (all your recent moves). If you accidentally reset or delete a commit, reflog can help you find it and recover it.
Unlike git log, reflog shows your local branch movements, not commit history. It's a safety net if you do something wrong.
Arjun accidentally does `git reset --hard` and loses 3 commits. He uses `git reflog` to find where those commits were, then `git reset` to get them back.
Git Reflog — Syntax
git reflog # Show ref updates (branch movements) git reset --hard <reflog-entry> # Recover from reflog entry
Learn Git Reflog step by step with Syllab's free interactive Git & GitHub tutorial — runnable code examples, practice exercises and instant AI feedback, all free with no signup. Explore the full Git & GitHub course →