git reflog یہ ریکارڈ کرتا ہے کہ آپ کی branch کا HEAD کہاں رہا ہے — ہر commit، checkout، reset، rebase، وغیرہ۔ یہ "کھوئے ہوئے" commits کو بحال کرنے کے لیے ایک حفاظتی جال ہے (بُرے reset، rebase، یا branch deletion کے بعد) جو غائب دکھائی دیتے ہیں لین ابھی بھی قابل بحالی ہیں۔
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.
