git reflog यह रिकॉर्ड करता है कि आपकी branch का HEAD कहाँ-कहाँ रहा है — हर commit, checkout, reset, rebase, आदि। यह "खोए हुए" commits को recover करने के लिए एक सुरक्षा जाल है (एक खराब reset, rebase, या branch deletion के बाद) जो चले गए प्रतीत होते हैं लेकिन अभी भी recoverable हैं।
Reflog क्या है
The REFLOG logs every movement of HEAD (and branch tips) in YOUR local repo:
→ every commit, checkout, reset, rebase, merge, etc. is recorded with a reference
→ it's LOCAL and includes commits not reachable from any branch (the "lost" ones)
→ Even if you reset/rebase away commits, reflog remembers where they were.
