Yeda AI Tips · #030

Restore Checkpoint: Your Undo Button

Cursor just rewrote three files you didn't ask it to touch. It put a component in the wrong folder, or it "helpfully" restructured a layout that was already fine. Your first instinct might be to start manually undoing changes file by file. Neither that nor re-prompting from scratch is necessary — every AI edit in Cursor creates a checkpoint, and one click gets you back to exactly where you were.

Why this matters more with agents than with autocomplete

Traditional autocomplete suggests one line at a time — you accept or reject it, and the blast radius is tiny. An agentic AI editor is different: it can touch multiple files in a single turn, restructure a folder, rewrite a function signature and every call site that depends on it. That's what makes it powerful, and it's also what makes a bad turn expensive to unwind by hand. Files are already changed on disk the moment the agent finishes — there's no implicit "preview" state. If the edit is wrong, you need an explicit way to revert it.

That's what checkpoints are for. They aren't a separate feature you have to enable; every AI-driven edit in a Cursor chat automatically creates one.

What restoring actually does

Each checkpoint marks the state of your files at a specific point in the conversation — typically right before an agent turn made changes. When you restore to a checkpoint, everything made after that point is discarded, and your files are reset back to how they were at that moment. It's a genuine revert, not a soft "hide this from view" — the files on disk go back to their earlier state.

This is the difference between restore checkpoint and simply scrolling past a bad response in the chat: scrolling past does nothing to your files, which stay changed. Restoring is the only way to actually undo edits that have already landed.

How to use it

  1. When an agent turn produces something wrong — the wrong folder, a broken layout, an overreaching refactor — scroll back up the chat.
  2. Find the checkpoint marker that sits just before the bad edit happened.
  3. Click restore checkpoint on that marker.
  4. Confirm. Everything generated after that point disappears, and your files revert to match — including files that were created or deleted in the meantime.

Cursor also exposes an "undo all" control in some contexts for reverting the most recent set of AI changes in one step, which is functionally the same safety net for the immediate last turn.

Where this earns its keep

Pitfalls

Building an AI feature? Yeda AI designs, audits, and ships production LLM systems.

Talk to us · Read the blog