git reflog บันทึกว่า HEAD ของ branch ของคุณเคยอยู่ที่ใด — ทุก commit, checkout, reset, rebase ฯลฯ มันเป็นตาข่ายนิรภัยสำหรับการกู้คืน commit ที่ "หายไป" (หลังการ reset, rebase ที่ผิดพลาด หรือการลบ branch) ที่ดูเหมือนหายไปแล้วแต่ยังกู้คืนได้
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.
