Claude Code incorrectly reverted user's uncommitted work while debugging
Resolved 💬 3 comments Opened Jan 2, 2026 by wdraike 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 ↗