GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Critical bug revert undo messages · Issue #10287 · anomalyco/opencode

Critical bug revert undo messages #10287

New issue
Copy link
New issue
Copy link
Closed
Closed
Critical bug revert undo messages#10287
Copy link
Assignees
rekram1-node
Labels
windows

Description

@Genrie9
Genrie9
opened on Jan 23, 2026
Issue body actions

Undo/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

  1. Have a project with recent commits (e.g., commits from the past 2 weeks)
  2. Use "revert messages" or undo in the OpenCode TUI to undo a recent message
  3. Run git status — shows many modified files
  4. 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

  • i input /undo just undo conversation,not file #8098 — opposite problem (undo doesn't revert files at all)
  • Undo/revert fails for files with non-ASCII filenames on Windows #10210 — undo fails for non-ASCII filenames on Windows
  • UI stuck on '2 message reverted' while model runs invisibly #9811 — UI stuck on 'message reverted'
Reacted by Andrea Giacon, Andri Salillari, Piotr Najda , newmanwang, Abhineet Biju and ZHUO Xu

Activity

  1. github-actions
    assigned
    rekram1-node
    on Jan 23, 2026
  2. github-actions
    added
    windows
    on Jan 23, 2026
  3. github-actions commented on Jan 23, 2026

    @github-actions
    github-actionsBot
    on Jan 23, 2026 – with GitHub Actions
    Contributor
    More actions

    This issue might be a duplicate of existing issues. Please check:

    • i input /undo just undo conversation,not file #8098: Files not reverted when using /undo (opposite problem but same undo/revert system)
    • Undo previous message incorrectly restores project state #5910: Undo command claims to restore to arbitrary state but doesn't actually apply changes
    • Unrevert from subdirectory overwrites files in other directories with stale versions #7775: Unrevert from subdirectory overwrites files with stale versions from weeks ago
    • Revert is incomplete #8607: Revert is incomplete - TUI only traces part of diff
    • UI stuck on '2 message reverted' while model runs invisibly #9811: UI stuck on 'message reverted' while model runs invisibly

    Feel free to ignore if none of these address your specific case.

  4. AndryHTC commented on Feb 4, 2026

    @AndryHTC
    AndryHTC
    on Feb 4, 2026
    More actions

    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
  5. Woukim commented on Feb 4, 2026

    @Woukim
    Woukim
    on Feb 4, 2026
    More actions

    This is killing me. I have to step out of OpenCode. So many lost changes

    And this will be the right decision

  6. f123888 commented on Feb 6, 2026

    @f123888
    f123888
    on Feb 6, 2026
    More actions

    It's hard to believe that a project with nearly 100,000 stars would have such a basic bug.

  7. Jebvvnnb commented on Feb 6, 2026

    @Jebvvnnb
    Jebvvnnb
    on Feb 6, 2026
    More actions

    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
  8. AledHe commented on Feb 13, 2026

    @AledHe
    AledHe
    on Feb 13, 2026
    More actions

    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

    Reacted by Andrea Giacon
  9. UPROOT01 commented on Feb 16, 2026

    @UPROOT01
    UPROOT01
    on Feb 16, 2026
    More actions

    #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

  10. AndryHTC commented on Feb 20, 2026

    @AndryHTC
    AndryHTC
    on Feb 20, 2026
    More actions

    #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

  11. github-actions commented on Apr 22, 2026

    @github-actions
    github-actionsBot
    on Apr 22, 2026 – with GitHub Actions
    Contributor
    More actions

    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
  12. github-actions
    closed this as completedon Apr 22, 2026
  13. BartekDeveloper commented on Jul 28, 2026

    @BartekDeveloper
    BartekDeveloper
    on Jul 28, 2026
    More actions

    It still happens.

  14. Cleroth commented on Jul 28, 2026

    @Cleroth
    Cleroth
    on Jul 28, 2026
    More actions

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @rekram1-node
    rekram1-node

Labels

windows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.