Guide

How to undo what an AI agent did in Notion, GitHub and files

7 min readBy the Delta MCP team

The Delta MCP Activity window: a task described in one sentence, its changes before and after, and an Undo button.

The short answer

Undo it in the tool where it happened, because each tool keeps its own history. In Notion, restore the page from Trash or Version history. In GitHub, revert the commit or restore the branch. For files, use Git, your AI app’s checkpoints or a backup. A message already sent is the hard one.

In this guide

How do you see what your AI changed?

Look before you undo, so you know exactly what to put back. Each tool keeps its own record of what changed.

  • Version history in Notion. On the page, click ••• at the top, then Version history. Pick a version to see the highlights of what changed. Notion saves a version every 10 minutes while someone edits, and again two minutes after the last edit.
  • git diff in a project under Git. It shows the edits you have not staged yet. git diff HEAD compares your files with the latest commit.
  • git reflog records each time a branch tip was updated in your local repository. If your AI may have moved or reset a branch, look here for where it stood before. Entries last 90 days by default, or 30 days for commits the branch no longer reaches.

If your AI worked through Delta MCP, Activity already shows each change before and after. More on that below.

How do you undo it, tool by tool?

Each tool keeps its own history, so you undo in the tool where the change happened. Find your case.

How to undo an AI’s change in Notion, GitHub and your files, with each tool’s limits and official page
What happened What to do Limits Official page
Notion: a page was edited Open the page, click •••, choose Version history, open an earlier version and click Restore. To keep today’s page, copy only the blocks you need. You need Can edit access. It goes back 7 days on Free, 30 on Plus, 90 on Business and any number on Enterprise. It shows the main highlights, not every change. A database restore brings back its pages and properties, not the text inside them. Notion: Delete & restore content
Notion: a page or database was deleted Open Trash in the sidebar, open the page and restore it. Pages stay in Trash for 30 days by default. Notion’s own MCP server deletes by moving pages to Trash, up to 20 per call. Notion: Delete & restore contentNotion: Supported tools (Notion MCP documentation)
GitHub: a pull request was merged Open it and click Revert. GitHub creates a new pull request that reverts the merge commit. Merge that one. You need write permission. With merge conflicts, revert the commits with git revert instead. GitHub: Reverting a pull request
GitHub: commits were pushed, or a file was deleted git revert HEAD records a new commit that undoes the latest one. Name another commit to undo that one instead. GitHub’s MCP file tools take a commit message, so their changes are commits too. It needs a clean working tree. To revert a merge commit, add -m 1 to name the parent that stays as the mainline. Git then treats the merged changes as never wanted. A later merge brings in only commits that were not part of it. Git: git-revert DocumentationGitHub: GitHub MCP Server (README on GitHub)
GitHub: a branch was deleted Open the closed pull request that used the branch and click Restore branch. It works for the head branch of a closed pull request. GitHub: Deleting and restoring branches in a pull request
GitHub: a repository was deleted Open Deleted repositories in the Settings of your account or organization, then click Restore. Within 90 days, and not if it was part of a fork network that is not empty. It can take up to an hour after the deletion before you can restore it. Team permissions are not restored. GitHub: Restoring a deleted repository
Files edited by Claude Code or Cursor Claude Code: run /rewind or press Esc twice on an empty prompt, pick a prompt and choose Restore code. Cursor: click a checkpoint in the chat timeline and restore it. Claude Code keeps snapshots for the last 100 checkpoints, and drops them about 30 days after the session’s last save. It does not track rm, mv or cp run through Bash. Cursor’s checkpoints revert files only. Both point to Git for permanent history. Claude Code: Checkpointing (documentation)Cursor: Overview (Agent documentation)
Files in a Git project git restore notes.md gets a deleted or changed file back from Git’s index. Add --source=HEAD to take it from your latest commit instead, or name another commit, branch or tag. It restores from the index or a commit, so Git can only give back what you committed or staged. Restoring overwrites the file as it is now, so run git diff first to see what you would lose. Git: git-restore DocumentationGit: git-diff Documentation
Files, with a backup On a Mac, open a window for the item, then open Time Machine from Spotlight. Step back through your backups with the arrows, select the item and click Restore. You need a Time Machine backup made before the change. Apple: Restore items backed up with Time Machine on Mac

What can’t be undone?

Some changes leave the tool where your AI made them, or outlast the time a tool gives you. No restore button reaches those.

  • A message already sent

    Gmail’s Undo Send is a button you get right after you send from its browser or app. You choose 5, 10, 20 or 30 seconds in Settings. Once that time is over, the message is out.

  • A file removed by a shell command

    Claude Code’s checkpoints do not track rm, mv or cp run through Bash. Look in Git or in your backup.

  • Anything past a time limit

    Notion keeps pages in Trash for 30 days by default. Notion’s support says it can also restore a snapshot of your content from the past 30 days. GitHub restores a deleted repository within 90 days.

  • What the change set off elsewhere

    A restore fixes the page or the code. It does not recall an email, a notification or anything else the change already triggered.

What does Delta MCP add?

Delta MCP is a free app on your computer. It sits between your AI and your tools, such as Notion, GitHub, Linear, Vercel or your files. It records what your AI changes through it, task by task, with each change before and after.

Each task is one sentence in Activity, such as “Set status to Archive on 4 pages in Notion”. Delta MCP writes it from the changes themselves. Undo starts there.

  1. Pick the task in Activity

    Search by sentence, connector, name or object. Open it to see each change, before and after. A change that Delta MCP read back and found in place is marked Checked.

  2. Click Undo and read the sheet

    The sheet says what Undo will do before it does anything.

  3. Click Undo again

    Delta MCP puts the changes back. Anything someone changed since is left as it is.

The sheet has up to three parts

  • Comes back: what Undo puts back, including deleted items that return as new copies
  • Changed since, left as is: what someone changed after your AI, which Undo does not touch
  • Doesn’t come back: what can’t be undone, such as a message already sent

So you know, before you click, what comes back and what doesn’t. Some actions can’t be undone, such as a message already sent. Delta MCP tells you which, before you click and again after.

It can also stop the change first. In the modes that ask, a card opens before anything is made. It shows each change before and after, and what can be undone.

Activity and Undo, in the docs

How do you stop it happening again?

Give your AI less rope, and keep a copy it cannot reach. Each setting is small, and each lives in a different place.

  • Start read onlyGitHub’s MCP server has a --read-only flag that offers only read tools. Open up writing when the task needs it.
  • Ask before deletingNotion marks its delete tools as destructive (destructiveHint). An MCP client can use that hint to ask before running one. Check whether your app does.
  • Commit before a long sessionCheckpoints in Claude Code and Cursor are for undoing your AI’s edits. Both point to Git for permanent history. Commit first, then let your AI work.
  • Keep a backupA backup made before the change brings back a file that was never in Git.
  • Pick a mode in Delta MCPFour modes, for each connector: change on its own, ask before deleting or sending, ask before every change, read only. You can set single actions apart. Delta MCP decides what counts as deleting or sending from the action’s name.

Modes, in the docs

Setting access in each tool has its own guide. How to give an AI access to your tools safely

Questions

Can you undo what an AI agent did?

Yes, in the tool where it happened, if that tool kept a history and its time limit has not passed. Notion has Version history and Trash, GitHub has revert and restore, and Git or a backup covers files. A message already sent is the exception.

How do I undo a Notion page my AI deleted?

Open Trash in the sidebar, open the page and restore it. Pages stay in Trash for 30 days by default. Notion’s own MCP server deletes by moving pages to Trash, so the same restore applies.

How do I undo my AI’s changes in GitHub?

For a merged pull request, click Revert on it: GitHub opens a new pull request that reverts the merge. For commits, use git revert. For a deleted branch, open its closed pull request and click Restore branch. A revert needs write permission.

My AI deleted my files. Can I get them back?

Check Git first: git restore notes.md gets a deleted file back from Git’s index. Add --source=HEAD to take it from your latest commit. In Claude Code, /rewind restores edits made with its file tools, not files removed by rm in Bash. Otherwise use a backup such as Time Machine.

Can you unsend an email your AI sent?

In Gmail, only in the seconds after you send from its browser or app. Undo Send lets you cancel for 5, 10, 20 or 30 seconds, as you set in Settings. Treat a message your AI sent as sent.

Does Delta MCP undo what my AI did?

Yes, for tasks that went through it. Pick the task in Activity, click Undo and read the sheet, which says what will be put back. Some actions can’t be undone, such as a message already sent. Delta MCP tells you which, before you click and again after.

Sources

  1. Notion, Delete & restore content Version history (access, limits by plan, highlights, database restore), Trash and its 30 days, and Notion’s backups.
  2. Notion, Supported tools (Notion MCP documentation) Notion’s MCP delete tools move pages to Trash, are marked destructive, and a restore tool brings pages back.
  3. GitHub, Reverting a pull request The Revert button, the write permission and the merge-conflict case.
  4. GitHub, Deleting and restoring branches in a pull request Restoring the head branch of a closed pull request.
  5. GitHub, Restoring a deleted repository The 90-day window, fork networks, team permissions and who can restore.
  6. GitHub, GitHub MCP Server (README on GitHub) The tools that write, with a commit message, and the read-only flag.
  7. Git, git-revert Documentation git revert records new commits that undo earlier ones; reverting a merge with -m.
  8. Git, git-restore Documentation Restoring files from a commit, branch or tag with --source.
  9. Git, git-reflog Documentation The reflog records branch tip updates; the 90-day and 30-day defaults.
  10. Git, git-diff Documentation git diff and git diff HEAD.
  11. Claude Code, Checkpointing (documentation) /rewind, the 100 checkpoints and about 30 days, and Bash changes that are not tracked.
  12. Cursor, Overview (Agent documentation) Checkpoints before significant changes; restoring reverts files only; stored apart from Git.
  13. Google, Send or unsend Gmail messages (Gmail Help) Undo Send and its 5, 10, 20 or 30 second window.
  14. Apple, Restore items backed up with Time Machine on Mac The steps to restore an item from a Time Machine backup.
  15. Delta MCP, Activity and Undo Activity, the Undo sheet, and the warning about what can’t be undone.
  16. Delta MCP, Modes The four modes and the card that shows each change before and after.

Keep reading

Try Delta MCP on your own tasks

Free, two minutes to set up, and you can put everything back in one click.

Free · No account · Apple chip or Intel

Free · No account

Free · No account

Follow the launch

For Mac, Windows and Linux. No account needed.

Coming soon

Delta MCP is almost here

The free app for Mac, Windows and Linux lands soon. Leave your email and you’ll hear the moment it’s out. No account needed.

We use your email only to tell you once when Delta MCP is out. No newsletter. Privacy policy