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

# Restore from a snapshot

> Save immutable state, inspect it, or fork it into a writable branch.

Snapshots preserve the current state of a volume or branch. They are immutable,
so you can return to the same files later without affecting the live volume.

This guide assumes you completed the [Quickstart](/quickstart) and have a
mounted `demo` volume with at least one file.

<Steps>
  <Step title="Create a named snapshot">
    From a terminal separate from the running mount, capture the current state:

    ```bash theme={null}
    amulet snapshot demo --name first-write
    ```

    The command prints the snapshot name and its immutable version.
  </Step>

  <Step title="List saved snapshots">
    ```bash theme={null}
    amulet snapshots demo
    ```

    The list includes the immutable version and creation time. Use either the name
    or version in later commands.
  </Step>

  <Step title="Mount the snapshot">
    Keep this command running while you inspect the snapshot:

    ```bash theme={null}
    amulet mount demo ./demo-snapshot --snapshot first-write
    ```

    Snapshot mounts are read-only.
  </Step>

  <Step title="Read the saved files">
    In another terminal:

    ```bash theme={null}
    cat ./demo-snapshot/hello.txt
    ```
  </Step>

  <Step title="Unmount the snapshot">
    ```bash theme={null}
    amulet unmount ./demo-snapshot
    ```
  </Step>
</Steps>

## Create a writable branch from the snapshot

Mounting a missing branch with `--from-snapshot` creates a writable fork:

```bash theme={null}
amulet mount demo@recovery ./recovery --from-snapshot first-write
```

Write changes through `./recovery`; the original snapshot remains unchanged.

## Snapshot a branch

Use the `volume@branch` form to snapshot and list an individual branch:

```bash theme={null}
amulet snapshot demo@experiment --name before-change
amulet snapshots demo@experiment
```

Mount it with the same branch reference:

```bash theme={null}
amulet mount demo@experiment ./experiment-snapshot --snapshot before-change
```

To create a new branch from that branch snapshot, specify both sources:

```bash theme={null}
amulet mount demo@retry ./retry \
  --from experiment \
  --from-snapshot before-change
```
