Feature request: bring back Undo / Redo for Codex-applied file changes

Resolved 💬 2 comments Opened Apr 4, 2026 by Eckel8080 Closed Apr 4, 2026

What variant of Codex are you using?

CLI

What feature would you like to see?

Codex CLI needs a reliable way to revert and re-apply the last AI-generated change set. Git is a useful fallback, but it is not a substitute for an in-tool undo model, especially when users are iterating quickly, working with uncommitted changes, or using Codex outside a disciplined commit flow.

I suggest restoring /undo and adding /redo, with semantics based on a single Codex task/change set rather than per-file edits. Each Codex write operation should create a lightweight checkpoint containing the affected files and their pre-change state, so users can safely revert file creations, modifications, deletions, and renames.

This should also integrate with chat rewind/fork behavior. If a user rewinds to an earlier prompt, the CLI should optionally restore the corresponding file checkpoint too, so conversation state and working tree do not drift apart.

Examples

Codex refactors 8 files and breaks tests → /undo should restore the whole change set.
Codex overwrites an uncommitted design doc → /undo should restore the exact previous contents.
User undoes a change, compares results, then decides the original Codex version was better → /redo should re-apply it deterministically.

This would make Codex much safer for real-world usage and reduce the risk of accidental data loss while preserving fast iteration.

Additional information

_No response_

View original on GitHub ↗

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