git reflog merekod ke mana HEAD cawangan anda telah pergi — setiap commit, checkout, reset, rebase, dan sebagainya. Ia merupakan jaring keselamatan untuk memulihkan commit yang "hilang" (selepas reset, rebase, atau pemadaman cawangan yang salah) yang nampaknya hilang tetapi masih boleh dipulihkan.
Apakah itu 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.
