Skip to content

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

@Eckel8080

Description

@Eckel8080

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIenhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions