You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What version of the VS Code extension are you using?
0.4.6
Which IDE are you using?
VS Code
What platform is your computer?
Microsoft Windows NT 10.0.26100.0 x64
What steps can reproduce the bug?
Ask codex in full agent mode to make a change to file
It makes a change a shows a diff window in chat
Click Undo at the top of the diff window
Green notification comes up showing changes reverted message but changes are not reverted in the file
What is the expected behavior?
The changes shown in the diff window that were applied to file should be undone/reverted.
What do you see instead?
The green message box with "Changes reverted" but the file still shows the updated content that was not reverted. Opening closing file does not make a difference.
Additional information
Tried several times between software restarts - the same issue persists.
Agent does not offer any insight or report any issue, says its a bug in the UI and offered to revert the changes himself.
Reacted by bhack, Jae, githycody, Josh000, Setya, Xander Pokhylenko, acook20-chwy, Tsukichan, merelogic, Alessandro Cosentino and 20 more
Im having a similar issue on version 0.4.10 of the vscode extension using gpt-5 codex. But when i click 'undo' i get a red pop-up messages that says "Failed to revert changes". And the diff window remains open with the changes in it;
Reacted by Alejandro Alfonso Hernández, Alexey and Yaroslav
The diff view you're on won't update if you click revert but should check the underlying file. Can you confirm if that works?
@setyanzxc123 are you seeing the green toast or is it red?
For both of you, is your code in a git repo?
Currently I'm on 0.5.11 pre-release version, the behavior is different here, on git repo it shows green toast and if I check on file it worked, but on non git repo it shows red toast
The diff view you're on won't update if you click revert but should check the underlying file. Can you confirm if that works?
@setyanzxc123 are you seeing the green toast or is it red?
For both of you, is your code in a git repo?
Currently I'm on 0.5.11 pre-release version, the behavior is different here, on git repo it shows green toast and if I check on file it worked, but on non git repo it shows red toast
Thats happen on gpt-5 model, but now I use model gpt-5-codex and it seems undo and changes feature not implement yet
This happened to me too, except something even more bizarre happened where I tried to undo, first time it didn't work, and then later I noticed at some point it had staged a change. Also one of the files I was working with wasn't saving and I couldn't figure wait why, and suddenly VSCode showed an error that a file has been changed since I opened it.
All very bizarre because usually any LLM coding agent I've used (including codex CLI, at least as of a few weeks ago) just makes changes to the local source which shows up instantly in all open files AND in source control.
Undo not working outside of a git repo. We're working on improvements to that so stay tuned.
Apply and undo behaving in unexpected ways when you have an open editor for that file, especially if it has unsaved changes of its own. The underlying issue here is that the extension uses the Codex CLI (this repo) to make changes rather than going through the editor. We'll also explore some options here. I think we can do better than we are today. For now, if the x on your tab is a circle and you think Codex may have touched that file, close the tab and discard your changes so it can pick up the filesystem changes.
@gpeal I was working within my git repo on Vscode, plugin was in local mode, and undo wasn't working.
Regarding your second point, i was using the Codex CLI for a few weeks before this latest new model and plugin setup, and I never had this issue... I always saw my files updated in realtime as Codex worked on them, and I never had the CLI try to stage anything.
In Codex.log, Codex was failing git calls with: git --no-optional-locks ... and Unknown option: --no-optional-locks.
Your VS Code session was resolving git to old /usr/local/bin/git (2.13.1), which breaks Codex revert/undo.
I fixed resolution by creating: /opt/homebrew/bin/git -> /usr/bin/git (2.50.1), which supports that flag.
I also added a fresh test change in notes.md:
Undo test after git fix.
Please click Undo/Revert on that change now.
If it still fails, run Developer: Reload Window once and retry, then I’ll inspect the newest log entries immediately.
in my case it was vscode not launching in wsl mode when running wsl code . in powershell. works after switching vscode to wsl or launching with wsl then code . from the project folder
I updated codex and ran into this issue myself. Previously it worked with older version, new codex version broke it.
If you are using it inside VS Code my fix was that even though codex was configured in its settings to run in WSL mode it ran in windows directly.
I had to install the WSL extension inside VS Code (Ctrl+shift+X), then i reopened the folder in WSL (F1 - > Type: WSL: Reopen Folder in WSL) and then i had to install the codex extension (even though i had it outside the WSL mode).
After this i tested and the undo button worked again at the shown diffs. Hope this helps those who encounter it.
Now it still not only doesn't work, but doesn't even show an error message. The button just does nothing. 30+ people reporting this, mentioned nearly every day somewhere or another, feature works fine for competitors, feature is crucial to workflow, and ticket is closed with no answers from developers. It's a shame since codex is one of the best coding agents/services out there.
Activity
setyanzxc123 commentedon Sep 15, 2025
+1 even on pre-released version 0.58 still doesn't work
gpeal commentedon Sep 15, 2025
The diff view you're on won't update if you click revert but should check the underlying file. Can you confirm if that works?
@setyanzxc123 are you seeing the green toast or is it red?
For both of you, is your code in a git repo?
josh000111 commentedon Sep 17, 2025
Im having a similar issue on version 0.4.10 of the vscode extension using gpt-5 codex. But when i click 'undo' i get a red pop-up messages that says "Failed to revert changes". And the diff window remains open with the changes in it;
gpeal commentedon Sep 17, 2025
@josh000111 Is your code in a git repo?
setyanzxc123 commentedon Sep 17, 2025
Currently I'm on 0.5.11 pre-release version, the behavior is different here, on git repo it shows green toast and if I check on file it worked, but on non git repo it shows red toast
setyanzxc123 commentedon Sep 17, 2025
Thats happen on gpt-5 model, but now I use model gpt-5-codex and it seems undo and changes feature not implement yet
josh000111 commentedon Sep 18, 2025
Yes. (by the way im using gpt-5 codex).
Polinarium commentedon Sep 18, 2025
Locally hosted code. Opened the file itself to check not just diff and no changes are not reverted. The toast is green.
maxiedaniels commentedon Sep 18, 2025
This happened to me too, except something even more bizarre happened where I tried to undo, first time it didn't work, and then later I noticed at some point it had staged a change. Also one of the files I was working with wasn't saving and I couldn't figure wait why, and suddenly VSCode showed an error that a file has been changed since I opened it.
All very bizarre because usually any LLM coding agent I've used (including codex CLI, at least as of a few weeks ago) just makes changes to the local source which shows up instantly in all open files AND in source control.
gpeal commentedon Sep 18, 2025
I'm hearing two separate things here:
maxiedaniels commentedon Sep 18, 2025
@gpeal I was working within my git repo on Vscode, plugin was in local mode, and undo wasn't working.
Regarding your second point, i was using the Codex CLI for a few weeks before this latest new model and plugin setup, and I never had this issue... I always saw my files updated in realtime as Codex worked on them, and I never had the CLI try to stage anything.
gpeal commentedon Sep 18, 2025
@maxiedaniels At the moment, undo works by:
We're going to be exploring some changes to revert that will hopefully remove this though. Fingers crossed.
TakiGuan commentedon Sep 30, 2025
Same issue here +1
SijaanX commentedon Oct 8, 2025
Same issue here.
My code is from a github repo.
36 remaining items
zba commentedon Feb 7, 2026
It seems degraded today, all my undo stopped worked after update
iamhectorlopez commentedon Feb 19, 2026
after a looong time... this issues seems to be fixed on my end.
adampieroni commentedon Feb 20, 2026
Codex fixed this for me! :)
Enferlain commentedon Mar 16, 2026
in my case it was vscode not launching in wsl mode when running wsl code . in powershell. works after switching vscode to wsl or launching with wsl then code . from the project folder
alanscandrett commentedon Apr 8, 2026
Encountered this in our team, 3 different developers with the same issue.
No resolution, none of the above advice worked.
drawenadmin commentedon Apr 15, 2026
Possible FIX:
I updated codex and ran into this issue myself. Previously it worked with older version, new codex version broke it.
If you are using it inside VS Code my fix was that even though codex was configured in its settings to run in WSL mode it ran in windows directly.
I had to install the WSL extension inside VS Code (Ctrl+shift+X), then i reopened the folder in WSL (F1 - > Type: WSL: Reopen Folder in WSL) and then i had to install the codex extension (even though i had it outside the WSL mode).
After this i tested and the undo button worked again at the shown diffs. Hope this helps those who encounter it.
ForteDexe commentedon May 13, 2026
almost half a year, still can't undo
hitem commentedon May 18, 2026
same issue here. none of the above things resolved it. (windows)
walkthroughspace commentedon Jun 8, 2026
this is still broken lmao, claude's undo works perfectly. how has this still not been fixed a year later? seems like such an easy feature to fix..
lywy233 commentedon Jun 12, 2026
same issue here.
justingoldentrulioo commentedon Jun 12, 2026
Now it still not only doesn't work, but doesn't even show an error message. The button just does nothing. 30+ people reporting this, mentioned nearly every day somewhere or another, feature works fine for competitors, feature is crucial to workflow, and ticket is closed with no answers from developers. It's a shame since codex is one of the best coding agents/services out there.
boiboif commentedon Jul 10, 2026
Undo still not work!
drawenadmin commentedon Jul 10, 2026
Have you guys tried my solution? Since then it works without issue for me.