# Cursor CLI: Add /undo command to revert agent changes

**URL:** <https://forum.cursor.com/t/cursor-cli-add-undo-command-to-revert-agent-changes/153522>\
**Category:** Feature Requests\
**Tags:** checkpoints, cli\
**Created:** [March 4, 2026, 5:45am UTC](https://forum.cursor.com/t/cursor-cli-add-undo-command-to-revert-agent-changes/153522 "2026-03-04T05:45:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Varun.Gawande](https://avatars.discourse-cdn.com/v4/letter/v/a8b319/32.png) [@Varun.Gawande](https://forum.cursor.com/u/Varun.Gawande)\
**Post date:** [March 4, 2026, 5:45am UTC](https://forum.cursor.com/t/cursor-cli-add-undo-command-to-revert-agent-changes/153522/1 "2026-03-04T05:45:38Z")

</div>

### Feature request for product/service

Cursor CLI

### Describe the request

The Cursor CLI currently has no way to undo the last agent action. This is a critical gap for context engineering — the practice of deliberately managing what the agent sees, does, and builds upon at each step.

Here’s why this matters beyond simple “oops, wrong output”:

Context poisoning — A bad agent turn doesn’t just produce bad code; it contaminates the conversation context. Subsequent prompts now reason on top of broken assumptions. You can’t fix this by just deleting files — the model’s in-context state is already dirty.

Iterative prompting requires rollback — Good context engineering means running a prompt, evaluating the result, and rewinding if the direction is wrong. Without undo, every bad turn forces a full git reset and a fresh session, destroying accumulated context that was working.

Claude Code has /rewind. OpenCode has /undo. This is becoming table stakes for any agentic CLI.

Request: A /undo command (or equivalent flag) that reverts the agent’s last turn changes and pops it from the active context window.  
The main Cursor IDE supports this and I hope it can be brought to the CLI as well.

---

<div class="post-metadata">

**Author:** ![Xiao\_xiao](https://avatars.discourse-cdn.com/v4/letter/x/58f4c7/32.png) [@Xiao\_xiao](https://forum.cursor.com/u/Xiao_xiao)\
**Post date:** [May 13, 2026, 7:02am UTC](https://forum.cursor.com/t/cursor-cli-add-undo-command-to-revert-agent-changes/153522/3 "2026-05-13T07:02:02Z")

</div>

Yes, we need undo functionality.

---

<div class="post-metadata">

**Author:** ![Lai\_Jinyi](https://avatars.discourse-cdn.com/v4/letter/l/58956e/32.png) [@Lai\_Jinyi](https://forum.cursor.com/u/Lai_Jinyi)\
**Post date:** [May 25, 2026, 3:55am UTC](https://forum.cursor.com/t/cursor-cli-add-undo-command-to-revert-agent-changes/153522/4 "2026-05-25T03:55:03Z")

</div>

+1. This is essential for the CLI agent.
