# Reviewing and undoing changes

> Review every file the KazoCode agent changes as a diff, keep or undo each change or the whole reply, and rewind a conversation with its files.

Every file the agent creates, edits, moves or deletes is recorded, so nothing it does is final until you say so.

## Change rows

Each change appears in the chat as a row under the reply that made it, with how many lines were added and removed. Click a row to open the diff in a tab, side by side or inline.

On each row:

- **Keep** accepts the change.
- **Undo** puts the file back exactly as it was before the reply, covering every change that reply made to it.

At the end of a reply, **Undo All** reverts every file the reply touched. A change is only marked undone once the file really is restored.

## Changes made by commands

When the agent runs a command that writes files, such as a code generator or a formatter, KazoCode notices which files the command changed and adds them as change rows too. That includes background jobs, like a dev server or a watcher, for as long as they run.

## Rewind the conversation

Edit one of your earlier messages to go back to that point. The later turns are removed and the files they changed are restored, then your edited message is sent. If a task is still running, KazoCode stops it and waits for it to finish before restoring anything.

## Changes from sub-agents

[Sub-agents](https://kazocode.app/docs/agent/agents.md) record their changes the same way. When one finishes, its changes are handed to the reply that started it, so you review and undo them in one place. A sub-agent that works in its own Git worktree leaves its changes there instead, and tells you how to merge them.

## Source Control

The agent's changes are ordinary changes to your files, so they also show up in [Source Control](https://kazocode.app/docs/editor/git.md), where you can stage them by file, hunk or line and commit them like your own.
