एक detached HEAD तब होता है जब HEAD सीधे एक commit की ओर इशारा करता है न कि एक branch की ओर। यह एक सामान्य state है (कोई त्रुटि नहीं) जो तब होती है जब आप एक specific commit, tag, या remote commit को check out करते हैं — लेकिन इसमें commit करने से काम खोने का जोखिम है, इसलिए इसे समझना महत्वपूर्ण है।
HEAD सामान्य रूप से किस ओर इशारा करता है
NORMALLY: HEAD → a BRANCH (e.g. main) → a commit
→ when you commit, the branch pointer advances, and HEAD follows it
DETACHED: HEAD → directly to a COMMIT (not through a branch)
→ you're "not on any branch" — looking at a specific commit
