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.

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 back | Where to look | What it covers | What it misses | Source |
|---|---|---|---|---|
| See what Codex changed | /diff in Codex | The Git diff, including files Git isn't tracking yet | It shows changes, it doesn't revert them | Codex docs |
| A tracked file's earlier version | git restore | Restores paths in the working tree from a restore source | Edits you never committed or stashed | Git docs |
| Your local changes, set aside | git stash | Saves local modifications and reverts the working directory to HEAD | Untracked files, unless you add --include-untracked | Git docs |
| Try again without losing the thread | /fork in Codex | Branches the session into a new chat, keeping the current transcript | Files on disk | Codex docs |
| Keep Codex away from your work | /worktree in Codex | Runs the chat in a separate checkout of your repository | Changes already made in your main checkout | Codex docs |
| Code or output you saw on screen | ReMynd screen history | Text that was on your screen in the window you were working in, after install | Anything before install, apps and sites you exclude | ReMynd |
A simple decision path
Stop at the first step that gets your work back.
- Stop the agent. Don't send "undo that". Every extra turn is another chance for a checkout.
- Read the diff. Run /diff and note which files changed, including new untracked ones.
- 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.
- 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.
- 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