Undo functionality should never depend on Git repository presence
What variant of Codex are you using?
Codex via VS Code extension (default model, not user-configurable)
What feature would you like to see?
Make "ask" mode the default, require explicit confirmation before applying any file changes, and clearly separate preview from execution to prevent unintended destructive edits.
Additional information
Undo should never depend on Git, especially when the tool can modify files automatically.
<img width="452" height="306" alt="Image" src="https://github.com/user-attachments/assets/f267407e-072d-41bc-84ab-11a9a174df47" />
In addition, undo functionality appears to depend on being inside a Git repository.
When attempting to undo changes made by the agent outside of a Git repository, the system shows an error indicating that undo requires a Git repository.
This is unexpected and problematic. Undo is a fundamental editor feature and should not depend on version control. It is expected to work as a local operation regardless of repository state.
This behavior becomes especially risky in combination with agent mode, which can directly modify or overwrite files.
As a result:
- Files may be overwritten
- Undo may be unavailable
- No reliable recovery path is provided
This creates a real risk of irreversible data loss during normal development workflows.
5 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I don’t think this is a duplicate.
I’ve reviewed the linked issues, and they appear to focus on incorrect or unexpected edits. None of them seem to address the combination of behaviors described here.
This issue is about something more severe:
Codex can apply changes without confirmation, while also lacking a reliable undo mechanism outside a Git repository.
This creates a dangerous failure mode:
As a result, files can be modified or overwritten with no way to recover the previous state, creating a real risk of irreversible data loss.
This is not just about incorrect edits — it is about the inability to recover from them.
If there is an existing issue that specifically covers both:
please point me to it. Otherwise, this should be tracked separately.
This also violates a fundamental expectation of editors: local changes should always be undoable, regardless of version control.
I would agree with the general feeling of not needind git to revert.
I don't believe it should be a default requirement for projects to be in GIT for a revert to work.
This lack of undo in combination with the removal of "Ask" mode is actually insane. So every prompt can change your code and there's no way to undo these changes.
Sure, you can ask codex not to change any code, but to do it every time? And to be sure it will listen to you?
It's hard for me to comprehend that someone thought this is a good idea.
@grujicd @Jean-Heng-Huang @grujicd — openai is slow!!! BUT every prompt being able to change your code with no way back is the case codex-rewind handles, and it does it without needing a repository, which is what this issue is asking for. It is Codex itself, unofficially built(you can clone and build for yourself or install with npm🥳🥰), tracking upstream releases with a file snapshot subsystem added, so nothing you use today goes away.
A checkpoint is taken before every turn automatically rather than when you remember to arm one — which is the part that matters when the exposure is every prompt. Snapshots go under
CODEX_HOME/and a restore writes file contents directly, never invoking git, so it behaves the same with no repository as with one.It also covers files git never tracked, which is where the losses actually happen: anything created and then overwritten inside a single turn was never in an index. So "requires a repo" and "only covers tracked files" turn out to be the same limitation from two sides, and fixing the first without the second would not have fixed much. Give an upvote if you found this useful.🥰
npm install -g codex-rewind, then runcodexr:https://github.com/extracurricular-ai/codex-rewind
Design write-up, including why the two previous git-based attempts failed the way they did:
https://github.com/extracurricular-ai/codex-rewind/blob/main/docs/rfc-file-snapshot-rewind.md