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

  1. User had uncommitted frontend changes (~1 day of work)
  2. Application had a rendering issue
  3. Claude assumed frontend changes were the cause and ran git checkout -- .
  4. Claude did NOT stash the changes first
  5. The actual root cause was a backend API bug (unrelated to the frontend changes)
  6. User's uncommitted work was permanently lost

Expected behavior

Claude should:

  1. Always use git stash before reverting uncommitted changes
  2. Investigate all potential causes before assuming the user's recent work is the problem
  3. 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

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗