How to Fix Git Detached HEAD Error - npm run build Fails After Git Pull: Fixes-How to Remove Stale index.lock in Git on Windows

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