GeezerVison is showing github.com — Critical bug revert undo messages · Issue #10287 · anomalyco/opencode
Critical bug revert undo messages #10287DescriptionUndo/revert reverts files to incorrect (old) state, deleting committed code
Description
When using the "revert messages" / undo functionality in the OpenCode TUI, files in the working directory were reverted to an old state (from weeks ago), not to the state before the reverted message. This caused ~1300 lines of committed code to be silently deleted from the working directory.
Steps to Reproduce
- Have a project with recent commits (e.g., commits from the past 2 weeks)
- Use "revert messages" or undo in the OpenCode TUI to undo a recent message
- Run
git status — shows many modified files
- Run
git diff --stat — shows massive deletions
Expected Behavior
Files should be reverted to their state before the undone message's changes, preserving all other committed code.
Actual Behavior
- Multiple files were modified (uncommitted changes appeared)
git diff --stat showed ~1300 lines deleted across ~35 files
- The deleted code was from commits made days/weeks ago (not from the reverted message)
- Affected files included core entities, DbContext, services, etc.
- Running
dotnet build failed with 40+ errors due to missing properties/entities
git reflog showed NO reset/revert operations — changes were only in working directory
git checkout -- . restored everything correctly
Environment
- OS: Windows 10
- OpenCode version: latest as of Jan 2026
- Shell: PowerShell / Git Bash
Workaround
Run git checkout -- . to restore all files to the last committed state.
Impact
High — This bug can silently delete large amounts of committed code without any warning. Users may not notice until build fails or runtime errors occur. If users commit these changes without reviewing, they could lose significant work.
Related Issues
Reacted by Andrea Giacon, Andri Salillari, Piotr Najda , newmanwang, Abhineet Biju and ZHUO Xu Activitygithub-actions commented on Jan 23, 2026 This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case. AndryHTC commented on Feb 4, 2026 This is killing me. I have to step out of OpenCode. So many lost changes Reacted by Woukim, f123888, Jebvvnnb, Amirreza, Benoit-Lorcy, newmanwang, Juan Marín, Eduardo Gomes Heleno, SOFe (Jonathan Chan Kwan Yin) and Pedram kalami Woukim commented on Feb 4, 2026
This is killing me. I have to step out of OpenCode. So many lost changes
And this will be the right decision f123888 commented on Feb 6, 2026 It's hard to believe that a project with nearly 100,000 stars would have such a basic bug. Jebvvnnb commented on Feb 6, 2026 I've encountered this problem as well, and not just once. I thought I accidentally pressed some button, but it seems this is an ongoing bug... I'm speechless. Reacted by Andrea Giacon, Jebvvnnb, Eduardo Gomes Heleno, Valaia, Daffa Ilhami and [V]andal AledHe commented on Feb 13, 2026 Same here via clicking a message and choosing revert. I was trying to revert a interruptted message, and see all my recent git diff also reverted. I realized something happened again felt really frustrated.
Looks like a simple restore/reset --hard if opencode bugged, but we don't know what the bug is, I suggest developers don’t simply do reset/restore (git) with the revert (opencode) for now. This causes disasters.
btw, after seeing the code diff showed up after the revert message, I tried ctrl+x r, no recovery UPROOT01 commented on Feb 16, 2026 #7775 (comment)
I think these two might be related because when i hit redo (after I got this other folder reverted to IDK when after an undo), it didnt redo the other foler, i had to restore my last commit which luckily was pretty recent but I completely do not trust the undo/redo commands right now AndryHTC commented on Feb 20, 2026
#7775 (comment)
I think these two might be related because when i hit redo (after I got this other folder reverted to IDK when after an undo), it didnt redo the other foler, i had to restore my last commit which luckily was pretty recent but I completely do not trust the undo/redo commands right now
Yes. It's a "you lied once, you are lier forever" situation github-actions commented on Apr 22, 2026 To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one. Reacted by Adam, Valaia, praveng, Muhamad Dwi Cahyo, Liu Jiaxi, Bartosz Zakrzewski and Cleroth BartekDeveloper commented on Jul 28, 2026 Cleroth commented on Jul 28, 2026 Chill guys, they need to wait for GPT 7 to fix this.
... Or just put "snapshot": false in your config and use something else because the snapshot system in opencode is just useless.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|