OpenCodesession-managementbuilt-in

/undo

Remove the last message and its responses, and revert any file changes made. Git-backed — requires a git repository. Keybind: Ctrl+x u.

When to use

  • Undoing a bad response from the AI
  • Reverting both conversation and file changes together
  • Rolling back when an edit went wrong

More OpenCode commands