codex icon indicating copy to clipboard operation
codex copied to clipboard

Please make "/undo" back

Open SunRunAway opened this issue 10 months ago • 104 comments

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

SunRunAway avatar Jan 14 '26 10:01 SunRunAway

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

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

Powered by Codex Action

github-actions[bot] avatar Jan 14 '26 10:01 github-actions[bot]

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

b20lopez avatar Jan 15 '26 13:01 b20lopez

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 ;)

embedding-shapes avatar Jan 15 '26 14:01 embedding-shapes

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?

TraFriTCR avatar Jan 15 '26 19:01 TraFriTCR

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.

b20lopez avatar Jan 16 '26 08:01 b20lopez

@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?

SunRunAway avatar Jan 16 '26 08:01 SunRunAway

@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.

etraut-openai avatar Jan 16 '26 08:01 etraut-openai

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.

miraclebakelaser avatar Jan 17 '26 12:01 miraclebakelaser

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?

embedding-shapes avatar Jan 17 '26 13:01 embedding-shapes

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

b20lopez avatar Jan 21 '26 04:01 b20lopez

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.

embedding-shapes avatar Jan 21 '26 11:01 embedding-shapes

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

b20lopez avatar Jan 24 '26 20:01 b20lopez

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.

RobRoyce avatar Jan 26 '26 21:01 RobRoyce

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 ?

zba avatar Feb 12 '26 01:02 zba

@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.

Alek2077 avatar Feb 12 '26 17:02 Alek2077

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

ANTONIOPSD avatar Feb 13 '26 05:02 ANTONIOPSD

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

JeanKaddour avatar Mar 28 '26 16:03 JeanKaddour

+1 please bring it back.

Eckel8080 avatar Apr 05 '26 08:04 Eckel8080

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

feiyehua avatar Apr 06 '26 10:04 feiyehua

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

ijin avatar Apr 07 '26 02:04 ijin