Undo changes from a coding-agent session
A coding agent can edit several files before you realize the result is not what you wanted. A checkpoint taken before the session gives you a known state to return to, including work you had not committed yet.
Review before restoring
Stop or pause the coding session before reviewing its changes. Read the file diffs and decide whether you want to keep part of the result. Copy anything you want to retain before restoring an earlier working tree.
A working-tree restore changes files on disk. It is different from asking the agent to reverse its own edits, which can introduce another set of changes.
Return to a RepoYard checkpoint
When you start a coding CLI in a repo through RepoYard, it checkpoints the working tree, including untracked files. In the repo's Overview, find Safety net and select Undo to here on the checkpoint from before that session.
Undo puts every file back as it was at the checkpoint. Edits are reverted, deleted files return and files created since are removed. Ignored files such as node_modules and .env are left alone. If the agent made commits after the checkpoint, they are taken off your branch, so it points where it did before the session. Commits already pushed stay on GitHub, because undo only changes your computer.
Anything you had staged becomes unstaged. The files keep their content, but you need to stage them again before you commit. Your stash is not touched.
RepoYard saves a Before undo checkpoint first. If you change your mind, select Undo to here on Before undo to get the files and the removed commits back.
Know what the safety net covers
Checkpoints require a Git repo with at least one commit and exclude ignored files. RepoYard keeps the last 20 checkpoints. A session launched outside RepoYard does not get a checkpoint from that launch. If no suitable checkpoint exists, review your Git history and any backups rather than assuming an earlier state can be reconstructed.
Undo only runs on the branch and in the working folder where the checkpoint was made. If you have switched branches, switch back first. It also waits until any merge or rebase in progress is finished.
Checkpoints are a local convenience, not a backup. They cannot reverse a database migration, an API call or a deployment. Keep your regular commits and backups, and review the selected checkpoint before restoring.

Try the workflow in RepoYard.
Windows 10 and 11, x64. Every feature for 7 days, then US$39.99 once. No RepoYard account needed.