Code and context rollback

Resolved 💬 4 comments Opened Nov 10, 2025 by moos1110 Closed Jan 17, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

The Codex terminal version lacks the ability to roll back code and context. When a generation goes wrong or the context becomes polluted, there is no way to quickly restore a stable state. This breaks the interactive workflow for writing and correcting code, making the terminal version practically unusable for real development.

Expected Behavior
Code rollback: Quickly switch to a previous code snapshot within the terminal session.
Context rollback: Restore to a specific conversation node to avoid error propagation.
Simple trigger: By pressing Esc twice, an interactive menu should appear, allowing the user to choose:
Roll back to a specific context node
Roll back to a specific code snapshot
Compare differences between versions

Current Behavior
No built‑in rollback mechanism.
Once an error is generated, the only option is manual copy/paste or starting over.
Context pollution accumulates and cannot be cleaned.
Iteration and review are inefficient.

Impact
Development efficiency drops: Stable iteration and branching experiments are impossible.
Risk increases: Once wrong code or prompts enter the context, they persist.
Not aligned with CLI workflows: Terminal users expect reversible, auditable operations.

Suggested Solution
Shortcut trigger: Double‑press Esc → open rollback selection menu.
Interactive choice: User selects which context or code snapshot to revert to.
Command fallback: Keep CLI commands like codex revert <tag> for advanced users, but Esc Esc provides a fast entry point.
Snapshot storage: Save snapshots in .codex/ directory, with optional tags for management.

Steps to Reproduce

  1. Start a multi‑round coding session in the terminal.
  2. Generate an incorrect output.
  3. Attempt to restore the previous correct version.
  4. Observe: rollback is impossible, only manual workarounds exist.

Environment
Systems: Linux / WSL / Termux / Windows PowerShell
Version: Latest stable terminal release of Codex
Project type: Multi‑file project requiring consistent context

View original on GitHub ↗

4 Comments

github-actions[bot] contributor · 9 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #4524
  • #5333
  • #5006
  • #4690
  • #6074

Powered by Codex Action

ZackHirshhorn · 9 months ago

I think these steps to reproduce are too general. I've been doing this countless times and never had a problem getting codex cli to rollback it's changes... Can you make them more specific? perhaps a code example and a specific broken change?

etraut-openai contributor · 7 months ago

This feature request hasn't received enough upvotes to keep open. There are other similar feature requests, so feel free to upvote those.

lly-ke · 5 months ago

Needed