Claude Code incorrectly reverted user's uncommitted work while debugging
Status Closed — duplicate
Maintainer reply None cached
Activity 3 comments · opened Jan 2, 2026 · closed Jan 6, 2026
Issue
Claude Code ran git checkout -- . to revert uncommitted changes without stashing them first, resulting in permanent loss of user's work.
What happened
- User had uncommitted frontend changes (~1 day of work)
- Application had a rendering issue
- Claude assumed frontend changes were the cause and ran
git checkout -- . - Claude did NOT stash the changes first
- The actual root cause was a backend API bug (unrelated to the frontend changes)
- User's uncommitted work was permanently lost
Expected behavior
Claude should:
- Always use
git stashbefore reverting uncommitted changes - Investigate all potential causes before assuming the user's recent work is the problem
- Never permanently delete uncommitted work
Impact
- Significant development work permanently lost
- Changes cannot be recovered
Session details
- Model: claude-opus-4-5-20251101
- Date: 2026-01-02
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗