avc undo
Reverses the most recent state-changing operation — a restore or a merge — with no arguments. AVC records every such operation together with the safety snapshot that reverses it, so undo never needs you to know which snapshot to go back to.
Running avc undo twice acts as redo: each undo records itself, so undoing an undo restores the state the first undo replaced.
avc undo # reverse the last restore or mergeavc undo --list # show recent operations without undoing anythingavc undo --json| Flag | Description |
|---|---|
--list | List recent operations (most recent first) instead of undoing |
--json | JSON output |
What it reverses
Section titled “What it reverses”| Last operation | avc undo result |
|---|---|
restore | Working tree returns to its pre-restore state (the safety snapshot AVC took before the restore) |
merge | main is restored from the pre-merge snapshot, and the merged branch is reactivated with its workspace rebuilt |
If the working tree was dirty when the original operation ran, that dirty state was captured as a safety snapshot and is what undo returns you to. On a clean tree, undo falls back to the branch HEAD.
Example
Section titled “Example”avc restore snap-abc123 # roll back to an earlier snapshot# ...realize that was a mistakeavc undo # back to where you wereavc undo # redo — forward to snap-abc123 againavc undowith no operations recorded yet exits non-zero with a clear “nothing to undo” message.- Undoing a merge marks the agent branch
activeagain and rebuilds its workspace, so you can resume the branch where it left off. - The operations log is also surfaced in
avc timeline, interleaved with snapshots.