Skip to content

the /undo command cannot undo the code modifications. #31338

@sfdeggb

Description

@sfdeggb

Description

In the build mode, the code was edited using opencode. The undo command was used to perform the rollback, but only the messages could be restored, and the changes to the source code could not be recovered. The project is managed in Git.
I noticed that many issues have been discussing this problem, but none of them have been resolved. This is truly a very serious issue.

Plugins

context7, mem0, sequential-thinking, tavily-search,superpowers@git+https://github.com/obra/superpowers.git, opencode-pty, opencode-supermemory@latest, "opencode-arise"

OpenCode version

1.16.2

Steps to reproduce

  1. Initialize the git repository
  2. Make the initial commit
  3. Ask opencode to create a bubble sort algorithm in a Python script
  4. Use the /undo command to undo this operation
  5. Display "1 message reverted" but the code modification did not go back

Screenshot and/or share link

  • git status
Image * the code before change Image
  • change code with opencode in bulid mode
Image * execute /undo command Image

** the message is undo,but the code is not**

Operating System

Ubuntu 20.04.6 LTS

Terminal

Bash

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions