Repository navigation
Description
Description
English Version
Title
[BUG] /undo does not restore code, and /redo corrupts Git state by committing all changes
Description
When the project is linked to Git, using the /undo command to revert the previous command in the conversation does not restore the code. Then using /redo completely messes up the Git state — all unstaged changes are committed (or forced into a single commit), breaking the normal Git workflow.
Expected Behavior
/undoshould revert all file system and code changes made by the last command, including discarding uncommitted edits./redoshould re‑apply the previously undone command, and should not interfere with Git history or trigger any automatic commits.- Same as Claude Code – have a double‑tap Esc feature that performs a normal undo/rollback without interfering with Git history.
Actual Behavior
- After
/undo, code files remain unchanged — no restoration occurs. - After
/redo, the Git repository is corrupted: all local changes are committed at once (seems likegit add . && git commit), disrupting incremental commit workflows.
Steps to Reproduce
- Start the AI coding assistant in a project that is already a Git repository.
- Execute a command that modifies code (e.g., edit or create a file).
- Type
/undoto attempt reverting the previous change. - Check the code files — they are not restored.
- Type
/redo. - Check Git status — all changes are committed automatically, and the history is messy.
Environment
- Assistant/IDE plugin version: (please fill)
- Git version: (please fill)
- OS: (please fill)
Is this normal?
No, it is not normal.
/undo and /redo should only affect the file system state of the current session. They must not manipulate Git’s commit history or automatically stage/commit files. The current /redo behavior is a severe bug (possibly incorrectly calling git commit or triggering a global save action), causing users to lose fine‑grained control over commits.
Suggestion
Please review the implementation of /redo to ensure it never automatically invokes Git commit commands. /undo and /redo should roll back file content using in‑memory snapshots or local backups, rather than interfering with the version control system.
中文版
标题
[BUG] /undo 无法恢复代码,/redo 导致 Git 混乱并提交所有改动
描述
在项目已链接 Git 的情况下,使用 /undo 命令尝试恢复上一次对话中执行的命令时,代码并未被实际恢复。随后使用 /redo 命令,Git 状态被严重破坏 —— 所有未暂存的改动被自动提交(或强制加入了一次完整提交),导致 Git 历史混乱。
预期行为
/undo应当撤销上一个命令对文件系统和代码的所有影响,包括回退未提交的编辑。/redo应当重新应用刚才被撤销的命令,且不应干预 Git 的提交历史或触发自动提交。- 和 Claude Code 一样,能够通过双击 Esc 实现正常的撤销 / 回退功能,且不会干扰 Git 历史。
实际行为
/undo执行后,代码文件保持原状,未恢复。/redo执行后,Git 仓库出现异常:所有本地改动被一次性提交(可能是git add . && git commit行为),打乱了正常的增量提交流程。
复现步骤
- 在已初始化为 Git 仓库的项目中启动 AI 编程助手。
- 执行某个修改代码的命令(例如编辑或创建文件)。
- 输入
/undo尝试回退上一步的改动。 - 检查代码文件 —— 发现并未恢复。
- 输入
/redo。 - 检查 Git 状态 —— 所有改动被自动提交,历史记录异常。
环境信息
- 助手版本 / IDE 插件版本:(请填写)
- Git 版本:(请填写)
- 操作系统:(请填写)
这是否正常?
不正常。 /undo 和 /redo 仅应影响当前会话的文件系统状态,而不应操纵 Git 的提交历史或自动暂存/提交所有文件。目前的 redo 行为属于严重错误(可能错误调用了 git commit 或触发了全局保存逻辑),会导致用户丢失细粒度的提交控制。
建议
请检查 /redo 的实现逻辑,确保不会自动调用 Git 提交命令。/undo/redo 应基于内存或本地快照回滚文件内容,而非干扰版本控制系统。
Plugins
superpower
OpenCode version
1.14.51
Steps to reproduce
Additional Reproduction Steps / 补充复现步骤
English:
Have a Git‑linked project with some existing commit history.
In a conversation, execute /undo – the files are not restored.
Execute /redo – the Git state becomes messy, and the files are restored to a much earlier (unexpected) state.
中文:
一个链接了 Git 的项目,且该 Git 仓库已有一些提交记录。
在对话中执行 /undo,文件并未被恢复。
执行 /redo,Git 状态混乱,文件被恢复到了一个很早之前的状态。
Screenshot and/or share link
https://opncd.ai/share/CaF35McR
Operating System
windows10
Terminal
windos terminal
Activity
github-actions commentedon May 15, 2026
This issue might be a duplicate of existing issues. Please check:
/undoand/timeline undodoes not revert file edits/undocommand only rolls back AI conversation message, not the associated file changes #5474:/undocommand only rolls back AI conversation message, not the associated file changes/undoonly reverts conversation, not code changes across repositories #26488:/undoonly reverts conversation, not code changes across repositoriesThe
/redocorrupting Git state aspect may be a new angle — if so, please confirm whether the above issues cover your case or if this is distinct enough to warrant a separate report.github-actions commentedon Jul 15, 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.