Fix Git 'index.lock file exists' Error - How to Bypass pip's Externally Managed Environment Error-Fix Detached HEAD in Git Without Losing Work

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