Review and Roll Back Agent Changes
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.
Rollback acts on the whole working tree. Use Discard File or reject individual hunks if you only want to undo part of a task.