> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wirevow.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Restore what the agent had

> Your branch and working tree are untouched. Read, run or copy from the worktree, then remove it with git worktree remove . Pass --to  to choose the location

## List a session's snapshots

```sh theme={"dark"}
$ gitvow snapshots
session 8f3d5c71   12 snapshots
  n  taken                tool   file                              changed vs HEAD
  1  2026-09-09 10:44:52  Edit   calc.py                           1 file
  2  2026-09-09 10:45:10  Write  tests/test_calc.py                2 files
  ...
```

`gitvow snapshots --session <id>` narrows to one session; `--all` lists every session in the repository.

## See what the agent had changed at that point

```sh theme={"dark"}
gitvow diff 8f3d5c71 2            # git diff --stat HEAD..snapshot
gitvow diff 8f3d5c71 2 --full    # the full patch
```

## Restore into a scratch worktree

```sh theme={"dark"}
$ gitvow restore 8f3d5c71 2
restored refs/gitvow/snapshots/8f3d5c71.../2 into /tmp/gitvow-restore/8f3d5c71-2 (detached worktree)
```

## Prune

```sh theme={"dark"}
gitvow snapshots prune --older-than 14d
gitvow snapshots prune --session <id>
```

## Turn off, or exclude more

In `.gitvow/policy.json` or `~/.gitvow/policy.json`:

```json theme={"dark"}
"snapshots": {"enabled": true, "max_per_session": 200, "exclude": [".env*", "*.pem", "*.key", "*secret*", "*credential*", ".gitvow/**", ".claude/**"]}
```

`exclude` patterns are git pathspecs applied on top of `.gitignore`; add your own for anything that must never enter a snapshot.
