GUIDE

How to undo in Cursor

Cursor can undo more than most people realize, and less than everyone hopes. Here's what each undo actually covers, in order of how fast you should reach for it, and how to make sure the next bad prompt can't cost you the project.

1. Mid-session: restore a checkpoint in the chat

When an agent edit goes wrong, look above the message in Cursor's chat panel. Each request has a restore control (a "Restore checkpoint" button) that returns your files to how they were before that request ran. This is the fastest undo and the one to try first.

Limit: checkpoints belong to that conversation. Start a new chat, switch projects, or let history age out, and they're gone.

2. One file went bad: your editor's local history

Cursor is built on VS Code, so every file keeps a local history on your machine. Open the file, then the Timeline panel (bottom of the Explorer sidebar), and click any earlier entry to see and restore that version of the file.

Limit: it's per file. If the AI edited nine files, you're restoring nine files by hand and hoping they agree with each other.

3. Plain Cmd+Z

Works while the change is fresh and the file is open. It's the weakest of the three: it doesn't cross files, doesn't survive closing the editor, and agent edits can bury your own edits in the undo stack.

All three share one gap: none of them can answer "put the whole project back to how it was on Tuesday, when it worked." That project-wide undo is the thing people discover they needed after losing a week.

Give the project a real undo (two minutes)

Plyo is the home for AI-built projects — every version saved, one click to undo, one click to publish. Your Cursor agent connects to it directly:

  1. Create a free Plyo account (3 projects, no card), make a project, and copy an AI key (Settings → AI keys).
  2. Paste this to your Cursor agent, filling in your project name and key:
Add this as the project's remote and push: https://git.plyo.dev/YOUR-PROJECT.git — username: plyo, password: plyo_YOUR_KEY. After each piece of work, push again so it's saved.

From then on, every working state is a checkpoint on a timeline you can see, with a plain-English note about what changed. Break something next month, in any tool, in any session? Open the timeline, click the version that worked, click Restore. Restoring never deletes anything, so even an undo can be undone.

This works from Claude Code and any other agent too — the point is that the safety net lives outside whichever tool you're using this week. The connect guide covers every tool.

Already lost work? Try this prompt

If the damage just happened, paste this into Cursor before doing anything else:

Some recent changes broke my project. Before changing anything: 1) list every file modified in this session, 2) check the editor's local history and any checkpoints for versions of those files from before the problem, 3) show me what you'd restore and wait for my OK. Do not rewrite code by hand from memory.

It stops the most common second disaster: the AI "fixing" the damage by rewriting files from memory instead of restoring the versions that existed.