[FEATURE]: Integrate /undo with Git for Better Change Tracking #2748

Open
opened 2026-02-16 17:37:05 -05:00 by yindo · 1 comment
Owner

Originally created by @mictadlo on GitHub (Nov 10, 2025).

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Hi,
Description
OpenCode currently has an /undo feature that reverts the last LLM change. However, it would be very useful if the /undo mechanism were integrated with Git.

Problem
Sometimes I want to review the exact edits made by the LLM and selectively keep parts of its suggestion instead of completely undoing it. The current /undo command doesn’t allow this fine-grained control or visibility into what was changed.

Proposed Solution
Integrate the /undo state with Git so that:

  • Each LLM change is committed automatically (or stored temporarily) as a Git revision.
  • Users can view diffs (git diff) between the current state and the LLM-generated changes.
  • This would allow selective reverts, partial staging, or manual adjustments using Git tools.

Example Use Case
After running a command that modifies a code file, I could git diff HEAD~1 to inspect the LLM’s edits, then choose which parts to keep or revert.

Benefit

  • Improves transparency and user control.
  • Encourages safe experimentation.
  • Leverages familiar Git tooling for reviewing AI-generated changes.

Thank you for consideration.

Originally created by @mictadlo on GitHub (Nov 10, 2025). ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request Hi, **Description** OpenCode currently has an /undo feature that reverts the last LLM change. However, it would be very useful if the /undo mechanism were integrated with Git. **Problem** Sometimes I want to review the exact edits made by the LLM and selectively keep parts of its suggestion instead of completely undoing it. The current /undo command doesn’t allow this fine-grained control or visibility into what was changed. **Proposed Solution** Integrate the /undo state with Git so that: - Each LLM change is committed automatically (or stored temporarily) as a Git revision. - Users can view diffs (git diff) between the current state and the LLM-generated changes. - This would allow selective reverts, partial staging, or manual adjustments using Git tools. Example Use Case After running a command that modifies a code file, I could `git diff HEAD~1` to inspect the LLM’s edits, then choose which parts to keep or revert. **Benefit** - Improves transparency and user control. - Encourages safe experimentation. - Leverages familiar Git tooling for reviewing AI-generated changes. Thank you for consideration.
yindo added the discussion label 2026-02-16 17:37:05 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 10, 2025):

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

  • #4081: undo does not undo todo list, resulting in agents continuing on the same path as the undo
  • #4125: opencode reverts developer modifications to the LLM generated code
  • #2379: [bug]: /undo is broken when you re-open opencode
  • #3463: [FEATURE]: undo last prompt if it exceeds token limit
  • #1286: Checkpoints System Suggestion (comprehensive Git-based checkpoint system)

The core request for Git integration with /undo shares significant overlap with these issues, particularly:

  • #4081 addresses undo functionality limitations
  • #4125 discusses similar problems with change tracking and LLM modifications
  • #1286 proposes a comprehensive Git-based checkpointing system very similar to your request

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

@github-actions[bot] commented on GitHub (Nov 10, 2025): This issue might be a duplicate of existing issues. Please check: - #4081: undo does not undo todo list, resulting in agents continuing on the same path as the undo - #4125: opencode reverts developer modifications to the LLM generated code - #2379: [bug]: /undo is broken when you re-open opencode - #3463: [FEATURE]: undo last prompt if it exceeds token limit - #1286: Checkpoints System Suggestion (comprehensive Git-based checkpoint system) The core request for Git integration with /undo shares significant overlap with these issues, particularly: - #4081 addresses undo functionality limitations - #4125 discusses similar problems with change tracking and LLM modifications - #1286 proposes a comprehensive Git-based checkpointing system very similar to your request Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2748