Understanding and Fixing Git Detached HEAD State - Fix Git Detached HEAD by Creating a New Branch-Fix Stuck Git Lock File Error

Final checklist
- Confirm that the same symptom is gone after a restart or refresh.
- Keep the smallest working change and undo temporary diagnostic settings.