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

# gandalf timeline: list and undo local history

> List local Gandalf timeline entries, inspect a single entry as JSON, and build a dry-run undo plan. Timeline undo is always non-writing.

`gandalf timeline` inspects the local history of Gandalf operations. It has three subcommands: `list`, `show`, and `undo`. Timeline undo builds a plan but never writes; it always requires `--dry-run`.

## Synopsis

```bash theme={null}
gandalf timeline list [flags]
gandalf timeline show <reference> [flags]
gandalf timeline undo <reference> --dry-run [flags]
```

`<reference>` is a timeline id or a snapshot name.

## Common flags

| Flag              | Description             | Default                          |
| ----------------- | ----------------------- | -------------------------------- |
| `-p`, `--project` | Project directory       | `.`                              |
| `--home`          | Home directory          | `$HOME`                          |
| `--store`         | Gandalf store directory | `~/.gandalf` or `$GANDALF_STORE` |
| `--agent`         | Filter by agent         | (unfiltered)                     |
| `--json`          | Emit JSON output        | off                              |

## timeline list

Prints entries as `- <id> <title> (<kind>) -> <after-snapshot>`. Add `--json` for a JSON array.

```bash theme={null}
gandalf timeline list --project .
gandalf timeline list --json
```

Corrupt timeline events are skipped and reported on stderr.

## timeline show

Prints one entry as pretty JSON.

```bash theme={null}
gandalf timeline show <id> --project .
gandalf timeline show baseline --json
```

## timeline undo

Builds a dry-run undo plan for a timeline entry. Requires `--dry-run`.

```bash theme={null}
gandalf timeline undo <id> --dry-run --project . --json
```

<Note>
  Timeline undo is always non-writing (`writesFiles=false`). To roll back an applied restore, use [`gandalf restore --apply --experimental`](/cli/restore) against the pre-apply safety snapshot.
</Note>

## Related

* [Terminal workspace](/guides/terminal-workspace)
* [`gandalf snapshot`](/cli/snapshot)
