Pitch
Codex/opencode parity. The model just made an edit you don't want. Today you'd `/restore` against a snapshot — but that reverts the whole workspace state, not just the last edit. `/undo` is surgical: revert just the most recent `apply_patch` / `edit_file` / `write_file` tool result.
Implementation sketch
- Every successful patch tool call records a per-file backup (we already have `snapshot::repo` + the workspace-side git mirror).
- `/undo` walks the most recent tool calls back, picks the first patching call, restores the affected files from that snapshot.
- Status toast: "Reverted apply_patch from turn N".
- `/undo 3` undoes the 3 most recent patching calls in reverse order.
Acceptance
Pitch
Codex/opencode parity. The model just made an edit you don't want. Today you'd `/restore` against a snapshot — but that reverts the whole workspace state, not just the last edit. `/undo` is surgical: revert just the most recent `apply_patch` / `edit_file` / `write_file` tool result.
Implementation sketch
Acceptance