← all articles

Codex undo changes: how to revert what Codex did now that /undo is gone

You told Codex to undo that, and it checked the file out from Git, taking your uncommitted work with it.

OpenAI's Codex CLI no longer has an /undo command. An OpenAI contributor wrote on GitHub that the experimental feature was removed, and it isn't in the Codex slash command list we checked on December 3, 2026.

To undo Codex changes now, run /diff to see what changed, then revert with Git yourself: git restore for files you want back, git stash to set your local changes aside. Don't ask the model to "undo that" while you have uncommitted work.

If the version you need was only ever on your screen, a screen history app like ReMynd can help you find what you saw in the window you were working in, starting from install.

Need the code you saw before Codex changed it? Download ReMynd

What does Git know about?

That's the better question to ask. Anything committed or stashed, Git can bring back. Anything that was only in your working tree is at the mercy of the next command, yours or the agent's. The /undo gap hurts most when the work in danger was never committed.

If your problem is a closed Codex chat rather than changed files, Codex resume session covers getting that back.

Diagram with the eyebrow Codex undo changes, titled No /undo? Git is your undo, subtitled Where your work lives decides how you get it back. Three rows: committed work, git restore brings a file back, green pill recoverable. Stashed work, git stash pop puts it back, green pill recoverable. Uncommitted work, highlighted in claret: run /diff first, asking the model to undo can check files out from Git, claret pill at risk. A dark bar at the bottom reads: Before a big turn, commit, stash, or use /worktree.

Where your work is decides how you get it back, per the Codex docs, OpenAI's GitHub replies and the Git docs. Illustration by ReMynd.

The 4 facts about Codex CLI undo

These four facts from OpenAI's GitHub explain what happened to /undo in Codex CLI.

  • /undo was removed. On issue #8804, an OpenAI contributor wrote that the /undo feature was experimental, saw relatively little usage, and its implementation was causing pretty significant problems for many users, including those who didn't use it. The issue was closed as not planned on January 7, 2026.
  • The config flag doesn't bring it back. On issue #8819, a user set undo=true in config.toml and the command still wasn't recognized. The reply said the experimental /undo command has been removed in recent versions.
  • "Undo that" is up to the model. On issue #9774, a user reported that saying "undo that" made Codex check out the file from Git, which loses work that was never committed. The OpenAI reply said this is model behavior, not under the control of the Codex harness, and pointed to /feedback.
  • The request is open. Issue #9203, "Please make /undo back", is still open. OpenAI said on #8819 that any return would need a redesign.

What each recovery option covers

Each option covers a different kind of change.

What you need backWhere to lookWhat it coversWhat it missesSource
See what Codex changed/diff in CodexThe Git diff, including files Git isn't tracking yetIt shows changes, it doesn't revert themCodex docs
A tracked file's earlier versiongit restoreRestores paths in the working tree from a restore sourceEdits you never committed or stashedGit docs
Your local changes, set asidegit stashSaves local modifications and reverts the working directory to HEADUntracked files, unless you add --include-untrackedGit docs
Try again without losing the thread/fork in CodexBranches the session into a new chat, keeping the current transcriptFiles on diskCodex docs
Keep Codex away from your work/worktree in CodexRuns the chat in a separate checkout of your repositoryChanges already made in your main checkoutCodex docs
Code or output you saw on screenReMynd screen historyText that was on your screen in the window you were working in, after installAnything before install, apps and sites you excludeReMynd

A simple decision path

Stop at the first step that gets your work back.

  1. Stop the agent. Don't send "undo that". Every extra turn is another chance for a checkout.
  2. Read the diff. Run /diff and note which files changed, including new untracked ones.
  3. Restore what Git has. For a tracked file you want back, run git restore on that path, or on the repository root to undo unstaged changes to tracked files. If you want to keep the current state around instead, run git stash, which saves your local modifications and reverts the working directory to HEAD.
  4. Rebuild what Git never had. For uncommitted edits Codex overwrote, check whether your editor still has the file open, or search your screen history for a line you remember.
  5. Guard the next turn. Commit or stash before a big Codex turn, or start it in /worktree, so a bad turn costs one git command.

A habit worth building: a quick throwaway commit before any turn that touches many files. That's the closest thing to a Codex rewind you control.

Where ReMynd fits

ReMynd is a desktop app that gives your computer local photographic memory, for you and your AI agents. It locally captures your screen history and keeps the searchable index on your computer.

So if the version of a function you need was in your editor or terminal, the window you were working in, after you installed ReMynd, it becomes searchable by what it said. ReMynd's Codex & ChatGPT switch sets up Codex on Mac and Windows, with a ReMynd command Codex can run to search that history.

Giving Codex the bug report you read in Slack shows the same move for context Codex never saw, and Codex memories in the ChatGPT desktop app covers what Codex itself remembers. If you also use Claude Code, Claude Code rewind covers its built-in undo. For the wider engineering setup, see ReMynd for engineers.

Your screen history is stored on your computer by default, and nothing is uploaded to us unless you turn on optional cloud sync. You can pause capture or block any app or site. That's how ReMynd's own pages put it, as of December 2026.

Codex uses OpenAI's model under your account, so what it retrieves may be sent to that model, the same way anything you paste into it would be. On a Mac, ReMynd needs screen recording permission, which Apple's guide puts in System Settings under Privacy & Security, Screen & System Audio Recording.

Honest limits

These are the limits I'd want to know before installing anything for this.

  • ReMynd doesn't restore files or replace /undo. Use Git for that.
  • ReMynd captures only what is on your screen, starting from install. It cannot recover past work, and it cannot see background or cloud agents.
  • Text recognition reads the window you're working in, so code in a window behind it won't be searchable by its words.
  • On a Mac, ReMynd needs Apple silicon and macOS 15 or later. ReMynd also runs on Windows 11 (x64 or arm64).

The short version

Codex has no /undo, so Git is your undo. Look with /diff first, then revert with Git yourself. For giving Codex context it never saw, AI coding agent memory of your actual work is the next read.

Want the code you saw before an agent changed it to stay findable? Download ReMynd

common questions

Does Codex CLI have an /undo command? +
Not anymore. An OpenAI contributor wrote on GitHub in January 2026 that the experimental /undo feature was removed because it saw relatively little usage and its implementation caused problems for many users. It isn't in the Codex CLI slash command list we checked on December 3, 2026.
How do I undo changes Codex made? +
Run /diff to see what changed, including files Git isn't tracking yet. Then use Git yourself: git restore for tracked files you want back, or git stash to set the current state aside. Avoid asking the model to "undo that" when you have uncommitted work.
Why did "undo that" wipe my uncommitted work? +
A Codex user reported on GitHub that saying "undo that" made Codex check the file out from Git, which loses work that was never committed. An OpenAI contributor replied that this is model behavior, outside the Codex harness's control, and asked people to report it with /feedback.
Is there a Codex rewind equivalent? +
Not a built-in one, as of December 3, 2026. The closest built-in tools are /diff to review changes, /fork to try another approach without losing the current transcript, and /worktree to work in a separate Git checkout. The open feature request for /undo is issue #9203 on GitHub.
How do I stop Codex from losing my work next time? +
Commit or stash before a big Codex turn, or run Codex in a separate worktree with /worktree. Then a bad turn is a git command away from gone.
Can ReMynd undo what Codex changed? +
No. ReMynd doesn't restore files. It helps you find what was on your screen in the window you were working in, after you installed it, like code or output you saw before Codex changed it.