Please make "/undo" back

Open 💬 62 comments Opened Jan 14, 2026 by SunRunAway
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What feature would you like to see?

It quite useful when:

  1. codex unintenally deletes some files which is not tracked by git.
  2. codex unintenally modify something when something is not git committed.

It bites me several times in recent days and I miss the /undo feature each time.

Additional information

_No response_

View original on GitHub ↗

62 Comments

github-actions[bot] contributor · 6 months ago

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

  • #8804
  • #8819
  • #8373
  • #8214
  • #7306

Powered by Codex Action

b20lopez · 6 months ago

Bro i lost too much progress just because the/undo is gone!!!! :( :( :(
Please put it back.

embedding-shapes · 6 months ago
codex unintenally deletes some files which is not tracked by git.

This happened to me too just these last days, out of nowhere, been using codex since it was available, and never had this happen to me before. Suddenly it wants to "keep the git repository clean" and deletes anything regardless of it existing before starting codex or not, it doesn't seem to realize what side-effects the commands it runs actually have.

Work around, actually check things into git or keep out of reach from Codex.

git is the real solution rather than /undo here as well, the sooner you learn it, the faster you'll be able to continue working without waiting for something to come back, which likely won't come back :) Ask codex to help you learn git ;)

TraFriTCR · 6 months ago

I find this mainly an issue where I'm working on something in a session, fine with the last few changes codex made, then it makes a bad change. If I don't remember to do a stash before the bad change then how am I supposed to revert without loosing all my progress?

b20lopez · 6 months ago
I find this mainly an issue where I'm working on something in a session, fine with the last few changes codex made, then it makes a bad change. If I don't remember to do a stash before the bad change then how am I supposed to revert without loosing all my progress?

Its gone.. asking codex to fix it will make it worse. Im forced to go back to using Claude.
Google anti Gravity is also a great alternative.

SunRunAway · 6 months ago

@etraut-openai Could you revert it back? If there is a particular reason to hide it, could you put it in experimental and warn people the reason when we enabling it?

etraut-openai contributor · 6 months ago

@SunRunAway, the previous experimental implementation had problems. It was causing many issues even for users who did not use the feature. If we bring it back, it will need to be redesigned.

miraclebakelaser contributor · 6 months ago

I used the feature often as well.

I use the following prompt as a hack to get codex to undo its changes:

I don’t like it. Undo the changes you just made in your previous message using the patch tool. Do not use git commands to revert your work. Do not touch anything else that appears changed unless you modified it directly in this session.

I use it often and it works reliably. It just takes longer. If you need to revert multiple turns, you have to send the prompt, wait for the llm to finish, backtrack and rinse-repeat.

The only caveat is that it cannot bring back deleted files. I agree with @embedding-shapes - even if the undo feature existed, it should not be considered a first line of defense against accidental file deletion.

embedding-shapes · 6 months ago

I'm not sure what the use of this feature is? Is my workflow different from others? How I work with Codex:

  • Start codex
  • Ask to do something
  • Once done, review it, and either:
  • "approve" it by committing it to git, then restart Codex from 0 and continue with something other task
  • or I got something wrong in the prompt, so I undo the work, then start a new conversation, making sure I fix the prompt
  • or it got something minor to fix, so do it myself/ask it to continue. Once done, git commit it, and restart Codex

Is this workflow different from how other people are using it? Are others not using git and saving/undoing via git when needed?

b20lopez · 6 months ago
I'm not sure what the use of this feature is? Is my workflow different from others? How I work with Codex: Start codex Ask to do something Once done, review it, and either: "approve" it by committing it to git, then restart Codex from 0 and continue with something other task or I got something wrong in the prompt, so I undo the work, then start a new conversation, making sure I fix the prompt or it got something minor to fix, so do it myself/ask it to continue. Once done, git commit it, and restart Codex Is this workflow different from how other people are using it? Are others not using git and saving/undoing via git when needed?

Ohhh,,, you read its work.
Hehe, for me who rely on /undo

I only check which files its working in..
I let it code. Observe the actual app.

if it did what i wanted, good, If not.
Most likely going to use /undo.

If AI is having a hard time,, thats the only time i read its code and find a solution myself.

other IDE's /coding agent have History you can switch back easily.
Claude, Cursor, AntiGravity

I dont know why in Codex they make it hard to undo

embedding-shapes · 6 months ago
I dont know why in Codex they make it hard to undo

Because you should be using git, a tool literally made for undoing changes to code when you need it.

b20lopez · 5 months ago
> I dont know why in Codex they make it hard to undo Because you should be using git, a tool literally made for undoing changes to code when you need it.

Yeah right

RobRoyce · 5 months ago
> I dont know why in Codex they make it hard to undo Because you should be using git, a tool literally made for undoing changes to code when you need it.

"Use git" is an asinine comment on this issue. What about when I want codex to review something before I commit it? What about when it does fine in the first 9 changes but completely screws up on the 10th?

Couple this with the fact that they removed granular write/edit permissions and codex is basically unusable.

Commit after every single interaction with codex? Why? Just use Claude Code, Cursor, Antigravity, and all the others that readily support undo _and_ expose granular permissions.

zba · 5 months ago

argument against git solution (btw you not need commit, just stage) - there are files like '.env' and other in .gitignore - you can't stage them and you can't undo them. Next solution is to use fs snapshots ?

Alek2077 · 5 months ago

@zba Indeed, some files aren't tracked, others are new, and it would be a great thing if there was a system for undoing things. Claude Code does this elegantly: they have a /rewind feature and a proper checkpoint system. Even Gemini CLI has it and looks like Codex is the only one behind in this. Nothing to offer whatsoever. Curious how OpenAI didn't yet implement this. The previous /undo was buggy. The product needs a proper rewind feature in both code changes as well as in conversation history.

ANTONIOPSD · 5 months ago

@etraut-openai
Well... you have access to a fully unlocked and unrestricted chatgpt version, ask it to fix it 😆

JeanKaddour · 3 months ago

+1 please bring it back. it's the top feature that makes me favor CC over Codex

Eckel8080 · 3 months ago

+1 please bring it back.

feiyehua · 3 months ago

+1 please bring it back. it's the top feature that makes me favor CC over Codex

ijin · 3 months ago

+1 I use this a lot in Claude Code, and this would make switching to Codex a lot easier.

mxvsh · 3 months ago

how is this still not in Codex CLI, this feature is preventing me from using it

AlexKenbo · 3 months ago

@zba raises a fair point — "just use git" misses gitignored and untracked files entirely.

Might help to split the rewind problem into categories, since one /undo probably can't cover them all:

  • tracked + committed → git
  • tracked, uncommitted → git stash
  • untracked / gitignored (like .env, or a new file Codex deletes) → filesystem snapshot layer
  • conversation state (step back N turns) → a fourth thing, independent of files

Judging from public artifacts, the previous /undo looked closer to the conversation-history side, which might explain why deleted-file recovery felt inconsistent. Treating the file layers and the history layer as separate features would probably be more robust than folding them together.

— @AlexKenbo

arniigreat1 · 3 months ago

+1

FlyAboveGrass · 3 months ago

+1 , really need this feature

jbergq · 2 months ago

I would add that /undo is also useful for:

  • Accidental fat fingers of Enter button, to go back and finish writing the prompt
  • Iterating/expanding on a previously sent prompt. For example, if my first instruction was too vague and Codex got started in the wrong direction, I'd prefer to go back and edit the original prompt to keep the context clean, rather than tell Codex this in a subsequent new prompt

I also would love if /undo optionally could undo file edits as well, like Claude's /rewind does.

Haume0 · 2 months ago

Please add a undo command this is not just a useful tool it's a necessary feature.

ed-thuando · 2 months ago

+1

seakros · 2 months ago

+1, but for a more in-depth /rewind type ability.

For example, you discover some issue and go off on a tangent from the mainline of work you were doing before. Once done and that loose thread has been tied up, you /rewind back to an earlier prompt of yours. You are given the choice to /rewind the conversation + any modifications, just the conversation, or just the modifications.

suparious · 2 months ago

Codex should not have built in functions to undo or redo code changes.

You tell codex "COMMIT but do not PUSH" and have it work in a git tree. You, as the human, can simply delete that commit off your disk to revert.

The real feature is a /rewind, to get to a previous point in the conversation.

zZer0o · 2 months ago

+1, /rewind is all i need

davidvanstory · 2 months ago

/rewind is needed.

suparious · 2 months ago

Only /rewind is needed. The user should be held responsible for their own undo/redo of the codebase, not this app.

Asking for this app to be responsible for maintaining the state of the codebase is ignorant to the amount of effort that puts on this project.

RobRoyce · 2 months ago
Only /rewind is needed. The user should be held responsible for their own undo/redo of the codebase, not this app. Asking for this app to be responsible for maintaining the state of the codebase is ignorant to the amount of effort that puts on this project.

Do you live under a rock? This feature has been in Claude Code and Cursor _forever_ and works flawlessly. This is like saying "asking IDE's to be responsible for maintaining the state of the codebase is ignorant to the amount of effort that puts on this project." They are an $800B company, I think they can hire a few devs (or, you know, use Codex)....

suparious · 2 months ago

This feature is not in Claude Code. The "Restore the code and/or conversation to a previous point" has nothing to do with the changes made to the code in the previous turn.

There is absolutely no reason to have your agent harness be responsible to undo changes, when the appropriate solution is to use git.

Liddo-kun · 2 months ago
This feature is not in Claude Code. The "Restore the code and/or conversation to a previous point" has nothing to do with the changes made to the code in the previous turn. There is absolutely no reason to have your agent harness be responsible to undo changes, when the appropriate solution is to use git.

Say you havent used Claude code without saying you haven't used Claude code
Rewind is probably one of the best features of Claude code. Codex NEEDS it.

hyper-lode · 2 months ago

Wow, can't believe this is not in codex

andrewchen5678 · 2 months ago

It is in everywhere like open code, github copilot, claude code, and many other major AI coding agents that I can think of except codex.

Cinzya · 2 months ago

Especially since Codex doesn't have an approval mode / read only mode, I would say it's even more important to be able to revert changes quickly / easier. Since Codex might apply code changes even when not instructed to. See https://github.com/openai/codex/issues/11915

I personally often just want to revert a partial file change it does throughout a longer session, while preserving other changes. This means I would need to instruct Codex to commit after every edit tool call, this can lead to a dozen of commits after a single session, which can get quite messy. My team and I prefer a clean git history, so this means I would need to cleanup / squash the git history after every session. That is quite a tedious process.

Sometimes you can get away by instructing it to revert in the conversation, but I don't want to rely on Codex doing this correctly and spend tokens for a revert.

Liddo-kun · 2 months ago

I switched to opencode. At least openai allows codex plan on opencode

vibewitharyaan · 2 months ago

Bring back the undo feature. It’s really painful when something goes wrong, because we can’t rely on git revert or committing every prompt.

suparious · 2 months ago

You know, using git locally does not require any upstream origin. Git just a tool, and does not require pushing your code anywhere.
The AGENTS.md file, with a simple instruction to "Test every change and COMMIT when GREEN, if RED fix the issue, then test again. Do not PUSH".
It is very reliable and Codex with gpt-5.5 follows this instruction flawlessly.

embedding-shapes · 2 months ago
because we can’t rely on git revert or committing every prompt.

God forbid you have to roleplay as an actual developer for some minutes per day...

crieggalder · 2 months ago

This is an important feature for power users and belongs in the CLI. It's a real quality-of-life advantage for Claude Code at the moment.

Peroledi · 1 month ago

I would think that, especially if you're running multiple chats at once making changes to code, it would be hard to undo specific items.

But in the desktop app I think if there was something more similar to a bookmark that, when you clicked it, it just saved a backup of that specific project folder at that given time, that would be beneficial because then you could always go back to that bookmark at any time if you needed to.

Haume0 · 1 month ago

Yea with multiple codex instances thats right but im using a single codex most of the time. Be able go undo recent message and changes would be dope.

grnbtqdbyx-create · 1 month ago

For anyone using git as the current workaround before a real Codex undo/rewind design lands, I added a conservative pre-agent checkpoint command in trace-to-skill@0.1.71:

npx trace-to-skill@0.1.71 checkpoint . --output .trace-to-skill/checkpoints/before-codex

It is not an official /undo replacement and it does not restore files automatically. It writes a local bundle before agent edits: status, staged/unstaged binary diffs, restore notes, and copied blobs for changed/untracked files. Ignored files are skipped by default because they may contain secrets; --include-ignored is explicit.

I made this after seeing the repeated theme here that conversation rewind and git history alone do not fully protect untracked or local-only workspace state. Release: https://github.com/grnbtqdbyx-create/trace-to-skill/releases/tag/v0.1.71

2022710010 · 1 month ago

Codex is the first agent I've used that doesn't support undo.

YourTechBud · 1 month ago

There is so many times that I give feedback to codex to go and fix something, only to find that it messed up. But I forgot to make a commit or add those files to staged so now I have to ask it to undo itself which is just so brittle.

Please give me back undo. I need it. Using Pi and OpenCode because of this.

Q1CHENL · 1 month ago

still no /undo seriously?

parasyte · 25 days ago

Don't be condescending. Git has its uses, but an undo stack is not one of them. Use the right tool for the job. In this case, we don't have one available to us.

edit: The comment I was responding to has been deleted.

zihang-huang · 23 days ago

I think this is really an essential and maybe must-need feature for coding agents. Every other coding agents has features like undo/revert/rollback, can't see a reason why this is so hard to be implemented.

Zouxxyy · 21 days ago

+1. I think an undo feature should cover both the workspace and the conversation.

From my perspective, every Codex interaction is a single transaction:

  • The code changes made by Codex.
  • The prompt and conversation state that led to those changes.

Both should be reversible together.

I need to be able to:

  • Roll back all file changes introduced by the last prompt.
  • Roll back the prompt itself and return to the conversation state before it was submitted.

Right now, Git only solves the first problem, and even then it’s not ideal for iterative AI workflows. On the other hand, rewinding the conversation without restoring the workspace leaves the conversation and the codebase out of sync.

A true /undo (or /rewind) should restore both the conversation and the workspace to the state before the last interaction. That would make experimentation much safer and make it much easier to explore different approaches without worrying about leaving the session in an inconsistent state.

zzy-life · 20 days ago

Why don't the product managers at Codex try copying the features from Claude Code? Please prioritize this request; the "rewind" command is crucial. Since switching from Claude Code to Codex, I have to commit to Git after every single conversation, which is a huge hassle.

n1kalai · 19 days ago

it breaks things lots of time, also creates junk lots of time. there must be undo !

arty-hlr · 6 days ago

I guess I'll stay with GitHub Copilot then if there's no undo/rollback or any states saved. This should be a staple, being able to see changes from the current session (independent from git) and being able to rollback to a previous point in the chat. 🤷‍♂️

irexyc · 3 days ago

Often, the results of an execution are unsatisfactory, and you want to revise the plan and run it again. In such cases, to revert to the original state of the initial plan, you have to manually fork the first plan session—a cumbersome process. I really can’t understand why there isn’t a rewind feature like the one in Claude Code.

Mahkhmood9 · 3 days ago

Make take on it , over the last year - the reverting feature within Codex-ide was a bit bad

<img width="506" height="576" alt="Image" src="https://github.com/user-attachments/assets/963074d2-c61f-4f47-9ab7-d96609899517" />

over the last two weeks , this feature heavily improved in codex-ide (where it was unuseable before)

if it works in the codex-ide - why not in the codex-rs? (olders chats? long chats? compacting issues? Data quality issue --dont make this feature because it ruins the chats? )

I thikn it does work great in the codex-ide

no opnion how it functions over chatgpt-desktop-codex

but its beautifually works now

-----

second you can just tell codex -- "please undo this feature" , "please change this function this way , I like it act like this and this"
(which seems like a better design - if you want to build better models)
(along with more complex tool calling -- that cause less steps) (also user "intent" accross few chats/threads --- what he wanted to achieve? was he so mad he opnned few threads over it? hard to answer because your chats can get long and you move for few ideas and feature within the same long thread) -
"Please undo this function - I want this functionality to be removed -- make this function removed or change"

why I argue is - that its improtent that the user give feedback in what he want to change - (also a user can accidentily type /undo - not understand what it does -- causing the user to actually pawn what he made) ,, but you argue why some call it "rewind"or "undo-code"

Mahkhmood9 · 3 days ago

again wth the era of gpt 5.1 it was when this was removed (December 2025) --- I think as it stands now -
I think its a good idea to consider getting it back considering its in codex-ide

and the ideas of source-control/git/svn --- is already had time to understand what in the scope --- but I personally think people should ask the Codex/gpt/llm to change or modify a feature potentially saving a lot of computer because they shouldnt do 4,000 lines of progress and then ask the msame thing but uhh people do it all day in chatgpt-desktop

but in terms of how you deal with what the model write lines of code --- has realized better (so maybe it can return and we have a /undo or /revert or /undo-code ) ----

last point - I think its harder to see what you /undo what if you undo a line you didnt wanted?

ide are better you can see which lines you edited better, in the TUI its a bit annoying you cant scroll back --- some terminal emulators are faulty or misconfigured

if its going to harm the people wil use it by mistake - thinking its another command/quality of data/or cause to much gpu consumption the answer - do not return the /udno

-----
in the realms of open source - you can modify the codex-cli and play with
how you should use coding agents , and git source (funny how histroically in the medical world you would need a paper to prove or disporove it -- if you should have it or not have it - or how and what is the best)

I would like to say that as of today - /rewind /undo in Claude is very broken

in the realms of Re-search and Open Source - I recomend
for students at universities (I recomend try to make a thesis or side thesis about this - maybe try to get it approved - unrelated to your current work -- this issue is unsolved)

you need to replicate , all of the issue users are facing - and design a way it rarely happens - and the best designed ideas
granted this issue is highly debated already ---

right now the greatest issue is the "harness" the way it read the way it handles -- the way we cant new models every month or two -- the way how rapid the code changes ---- it better just to ask to LLM "please change this and this" due to the nature of how harnesses work (I argue this yes)

if you can make an evaluation on where undo/rewind work or doesnt work - you should fix it (wheter it is by understand how git stash work or how you deal with git branches --- or if coding agents need something simular-yet-not-git for "source control")
I think telling the chatgpt please undo this function / I dont like how this functionality works --- actually works as today
BUT /rewind has its place ----- in the codex-ide it was barely working -- now it feels flawless for example --- if its mature for codex-cli too ? who knows terminals serve a purprse today that is not code development (as fast rapid VIM development can be or EMACS or whatever ---- personally for me I like to relay on other people work --- if php is annoying and big -- I am not going to use another framework I will try to use nuxtjs --- but if its too big for me I find the smallest solution --- if this doesnt help I need to learn how to better use the IDE and see what practices people who are the best do in terms of saving themselves time --- learn shortcuts , learn tips , try to find alternatives always ,, as per fundematials its extremely complex how to deal with what the coding-agent writes and if you want to rewind it ---- or if it consume more gpu or vram or you need to reload something weird --- or you cant undo it after a while --- if you intent changed over time)

also on opencode
https://github.com/anomalyco/opencode/issues/31338
as revent as april serious issue like deadlocks within the /rewind feature in claude code
https://github.com/anthropics/claude-code/issues/52209
as per anthropic maybe its bun[why you need to reinvent the wheel, rust is already standartized for few years] or nodejs or zig (or the port to rust) and I get it javascript guildlines updated for the better but its still not an exscuse - and rust has its issues too but you can have tricks and adopt - not relay on someone else "4 layers engine"

<img width="1171" height="911" alt="Image" src="https://github.com/user-attachments/assets/07c21de0-d567-4ee3-a226-4a6e9065273f" />

<img width="883" height="635" alt="Image" src="https://github.com/user-attachments/assets/851c3759-b4a6-42e3-9872-e895bbcda6d7" />

<img width="858" height="396" alt="Image" src="https://github.com/user-attachments/assets/35418c10-5bdd-4102-b3ad-7d180969d456" />

Quest79 · 3 days ago

There is something seriously wrong with how you guys are going about dev if something as BASIC AS UNDO needs a bunch of community thumbs up to add it back in properly. Just do it. This is embarrassing to even have up. Rewind/undo/non-destructive editing whatever tech you want to use.

It is beyond ironic that an app designed to _help people code well_ IS MISSING THIS.

Mahkhmood9 · 2 days ago
There is something seriously wrong with how you guys are going about dev if something as BASIC AS UNDO needs a bunch of community thumbs up to add it back in properly. Just do it. This is embarrassing to even have up. Rewind/undo/non-destructive editing whatever tech you want to use. It is beyond ironic that an app designed to _help people code well_ IS MISSING THIS.

Its not as easy as you think - I think gitis used in many verious ways

there is MODEL BEAVIOR amd then there is working correctly with the ideas of git ---

sometimes there is the latest commit

sometimes you can commit to a different branch

sometimes you check a pull request

sometimes you git git stash

I personally think there is a way maybe create a system alternate to git that is lean and good- OR make git adjusted to the age of LLMs
like chrome for example now allow MCP attachment , Chrome actually has a very cute way of doing things, like attaching to the chrome like a debugger - which is VERY COOL

Mahkhmood9 · 2 days ago
There is something seriously wrong with how you guys are going about dev if something as BASIC AS UNDO needs a bunch of community thumbs up to add it back in properly. Just do it. This is embarrassing to even have up. Rewind/undo/non-destructive editing whatever tech you want to use. It is beyond ironic that an app designed to _help people code well_ IS MISSING THIS.

I gonna agree with you on this, it does seems come in nature, but I will argue -- there is a data quality issue for people who actually design the models --- I think its very buggy ---- you start a new chat -- go you back to the older chat -- you have an issue cuz you move to the new Thread/chat now everything -- and this gonna make issues (and you cant just say "you cant rewind older threads") because you also have this subagents half-backed stuff too

````
The Underlying Engine (xdiff): The heavy-lifting engine inside git diff is a customized version of LibXDiff, a library originally written by Davide Libenzi. The Git team vendorized this code straight into the Git source tree under the /xdiff directory so they could radically modify and optimize it to suit Git’s specific needs.

`````
I had an idea maybe the people who like to write Diff, maybe they have good speculation of such thing should be designed
<3

Quest79 · 2 days ago

It doesn't matter how buggy it is right now, it will improve over iterations. What does matter is missing extremely basic and vital functionality. I rather have it crash every hour than not have proper undo. This is an established feature in apps like this for the last half century and they are HAVING A VOTE IF WE WANT IT IN THE APP. There arnt words to describe this without getting banned. Stop playing games, devs.