[BUG]

Resolved 💬 4 comments Opened Apr 4, 2026 by maxment0703 Closed May 14, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Claude Code ran git restore lib/ without user confirmation, permanently deleting all uncommitted working tree changes across 40+ files. All work built across multiple previous
Claude Code sessions was permanently lost with no way to recover.

What Should Happen?

Claude Code should NEVER run destructive git commands (git restore, git reset --hard, git clean, etc.) without explicit user confirmation — especially when uncommitted changes exist
in the working tree. It should first warn the user, show what will be deleted, and require confirmation before proceeding.

Error Messages/Logs

No error message was shown. Claude Code silently ran `git restore lib/` and all 40+ modified files were overwritten with the last commit state. The user was not warned that
  uncommitted work would be permanently deleted.

Steps to Reproduce

  1. Have a Flutter project with 40+ uncommitted modified files (working tree changes)
  2. Ask Claude Code to add a feature (light/dark theme toggle)
  3. Claude Code encounters a bug in its own script, corrupting files
  4. Claude Code runs git restore lib/ without confirmation to "fix" the corruption
  5. All uncommitted working tree changes are permanently deleted

Claude Model

Sonnet (default)

Is this a regression?

No, this never worked

Last Working Version

2>&1

Claude Code Version

N/A

Platform

Other

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

  • Project: Flutter app (PTro Map), D:\ptro_map
  • The lost work included: AppColors design system, photo upload feature (wechat_assets_picker), trainer/center detail screen UI refactoring, and other UI/logic changes built over

multiple paid Claude Code sessions

  • VS Code Local History was empty because Claude Code tool edits bypass VS Code's save history
  • Recuva file recovery attempted but unsuccessful due to subsequent disk writes
  • This resulted in significant loss of time and money for the user
  • The git repo had only 1 commit ("UI 리팩토링 전 백업"), so no recovery was possible

View original on GitHub ↗

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