Skip to content

CLI: Add /rewind checkpoint restore that reverts both chat context and Codex-applied code edits #11626

Description

@Alek2077

What variant of Codex are you using?

CLI

What feature would you like to see?

Add a native /rewind checkpoint flow that restores both:

  • conversation state
  • Codex-applied workspace edits

from the same selected checkpoint.

Current behavior: Esc rewind only rewinds conversation/history (fork point), but does not revert code changes made after that point.

Requested behavior:

  • /rewind shows recent checkpoints with:
    • timestamp
    • prompt snippet
    • files changed
  • Selecting a checkpoint rewinds chat and reverts Codex-made edits after that checkpoint.
  • Provide a pre-apply preview of file changes to be reverted.
  • Allow editing the restored prompt before resubmitting.

Safety requirements:

  • Only revert Codex-created edits after the selected checkpoint.
  • Do not touch unrelated local changes that existed before checkpoint creation.
  • If any file cannot be cleanly restored, show conflicts and require explicit confirmation before partial apply.

Additional information

Repro for current gap:

  1. Ask Codex CLI to modify files.
  2. Press Esc twice to rewind a prior user message and fork.
  3. Conversation rewinds, but prior file edits remain in the working tree.

Workarounds today (/diff, !git diff, manual git restore/reset) are useful but fragmented. A unified checkpoint rewind would make iterative prompting much safer and faster.

Related context: #9203, #4487, #8819.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displayenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions