Go back after a bad edit
Compare with a snapshot and restore the worktree.
Works inDesktop appTerminal UICLI
Go back after a bad edit
Snapshots are copies of an agent's worktree. The server takes them when an agent goes idle or finishes; you can take one by hand.
$ shepherd snapshot capture coder-1
created snapshot coder-1/1 (manual, 6 file(s), +20 -0)
# ... a bad edit happens ...
$ shepherd snapshot diff coder-1/1
coder-1/1 -> current
M f.txt +1 -0
1 file(s), +1 -0
$ shepherd snapshot restore coder-1/1 --confirm
restored 6 file(s) from coder-1/1
previous state saved as coder-1/2 (pre-restore)The restore saved what was there first, so you can undo the undo. To bring back one file: snapshot restore coder-1/1 --path f.txt --confirm. Keep only the newest ones:
$ shepherd snapshot prune --agent coder-1 --keep 1
pruned 1 snapshot(s): coder-1/1 (1 kept)In the app: Snapshots, Compare with the worktree now, Restore worktree, Prune older ones. In the terminal UI: t on an agent.
Was this page useful?Suggest an edit on GitHub