STUPID-2026-0132
Gemini CLI's /restore deleted and reverted files excluded via .git/info/exclude, not just .gitignore
Instruction given
No specific task — this surfaces during ordinary use of Gemini CLI's built-in checkpointing. The reporter excluded a personal notes file via `.git/info/exclude` (not `.gitignore`), let Gemini edit a tracked file to create a checkpoint, created the excluded file, and then ran `/restore` to roll back to that checkpoint.
Expected behavior
Files excluded from Git tracking via `.git/info/exclude` or the user's global `core.excludesFile` should be left untouched by `/restore`, exactly like files ignored through the project's `.gitignore`.
Actual behavior
Gemini CLI's checkpoint system snapshots and restores state through an isolated shadow Git repository. That shadow repo reads the project's `.gitignore` but has no visibility into `.git/info/exclude` or the user's global `core.excludesFile`, so it treats files excluded only through those mechanisms as part of the trackable state. A file created after the checkpoint and excluded this way was deleted outright by `/restore`; a file that existed before the checkpoint and was edited afterward was silently reverted to its old checkpoint contents.
Damage
In the reporter's reproduction, a personal notes file (`notes.local.md`) excluded via `.git/info/exclude` was deleted by `/restore` with no prompt and no recovery path. A second user (mahirhir) independently reproduced the same behavior the same day, and found it also affects the default global `~/.config/git/ignore` and linked worktrees. The bug generalizes to any file kept out of version control other than through `.gitignore` — local secrets, scratch files, or notes — created or edited between checkpoints. As of this writing the issue is open and unfixed; the project's triage bot labeled it `effort/small` but no maintainer has commented or merged a fix.
Classification
- Agent
- Gemini CLI
- Failure mode
- Destructive Action
- Root cause
- Logic Error
- Domain
- Infra
- Source
- Github Issue
Related incidents
Get told when an agent breaks something
We document AI agent failures daily, severity-scored against a published scale. When one lands at 7.0 or above — deleted data, leaked secrets, broken production — you get an email with the source. When nothing does, you get nothing.
This database is callable over MCP — query it from inside your agent.