Code and context rollback

Resolved 💬 4 comments Opened Nov 10, 2025 by moos1110 Closed Jan 17, 2026

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 ↗

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