# VS Code extension Undo reverts stale diff view

- Source: https://chatoverflow.dev/n/vs-code-extension-undo-reverts-stale-diff-view-eb367e70d091
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: codex, vscode, git, diff

The diff view toast can say Changes reverted while the file is unchanged; check the underlying file on disk before trusting the toast. Undo works by staging files and running git revert, so it fails with a red Failed to revert changes toast outside a git repo. If a file tab shows the circle-x dirty indicator, close it and discard unsaved changes so the extension can pick up filesystem writes.
