> ## Documentation Index
> Fetch the complete documentation index at: https://a5eb32f-docs-2.manicule.dev/llms.txt
> Use this file to discover all available pages before exploring further.
> For every page in one file, fetch https://a5eb32f-docs-2.manicule.dev/llms-full.txt (large).
> To search and read these docs as tools, connect the MCP server at https://a5eb32f-docs-2.manicule.dev/api/mcp.
> Every agent surface: https://a5eb32f-docs-2.manicule.dev/.well-known/llms-manifest.json

# Review and Roll Back Agent Changes (/desktop/diff-viewer)

<!-- agent-signals: reading_time_min: 2 · est_tokens: 655 · updated: 2026-11-25 -->
Related: [Work in BhaiCode Desktop](/desktop/overview.md), [Delegate a Task in Agentic Canvas](/desktop/agentic-mode.md), [Edit Code and Ask About a Selection](/desktop/code-editor.md), [Run Commands in the Desktop Terminal](/desktop/terminal.md), [Review and Approve Agent Actions](/desktop/transparency.md), [Keyboard Shortcuts](/desktop/shortcuts.md)

> Compare agent edits across files, accept or reject individual changes, and restore a task checkpoint.

Open the multi-file diff viewer after an agent changes your project. It shows what changed across files so you can keep only the edits you want before merging. Use the smallest review action that matches your intent: a hunk, a file, or the whole working tree.

## Compare the old and new code

Switch to the **Unified** view to see additions and removals inline. Use the **Split** view when you want to read the old and new code side by side, such as when an agent rewrites a block rather than adding a few lines.

The viewer uses syntax-aware coloring. Green lines are additions, and red lines are removals. Within a changed line, word-level highlights mark the exact text that differs, so you can spot a changed argument or condition without rereading the whole line.

## Accept or reject changes at the right scope

A hunk is one changed block. Use **Accept** or **Reject** on individual hunks when a file contains both changes you want and changes you don't. For example, you can keep a fix to a condition without taking an unrelated formatting change in the same file.

| If you want to                              | Use                                                       |
| ------------------------------------------- | --------------------------------------------------------- |
| Keep or reject one block                    | **Accept** or **Reject** on the hunk                      |
| Keep every modification in the current file | **Accept File** applies them to your working directory    |
| Restore just the current file               | **Discard File** returns it to its exact pre-prompt state |

Read related edits across files before deciding. If you keep a change to a function's arguments, check that the associated callers and tests still match. Run the relevant tests after you've decided which edits to keep.

## Roll the working tree back to its checkpoint

BhaiCode records a temporary Git checkpoint for each completed agent task. To undo the whole task, click **Rollback to Checkpoint** in the toolbar. It restores the working tree to the state it was in before you submitted the prompt. These checkpoints give you a local undo history without adding to your permanent Git commit history.

<Warning>Rollback acts on the whole working tree. Use **Discard File** or reject individual hunks if you only want to undo part of a task.</Warning>

## Next

* [Run tests in the integrated terminal](/desktop/terminal)
* [See how the canvas hands off changes for review](/desktop/agentic-mode)
