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

# graft rollback

> Revert the current branch to a previous commit.

# `graft rollback`

Revert the current branch to a specific save point. This moves the branch ref backwards in the DAG — future commits will extend from the rolled-back state.

## Usage

```bash theme={null}
graft rollback [commit_hash]
```

If no commit hash is provided, an interactive prompt lists all commits on the current branch in reverse chronological order.

## Behavior

1. List commits on the active branch (or use the provided hash)
2. Stop the container
3. Load the target commit's tree entries
4. Materialize those files from the object pool into the branch directory
5. Move the branch ref to the target commit
6. Start the container

## Examples

### Interactive Rollback

```bash theme={null}
graft rollback
```

```text theme={null}
? Select a save-point to roll back to:
  ▸ a1b2c3d - initial data setup (2026-06-04T11:59:00Z)
    f0e1d2c - after migration (2026-06-04T12:30:00Z)
```

### Rollback by Hash

```bash theme={null}
graft rollback a1b2c3d
```

```text theme={null}
Rolling back to a1b2c3d...
Successfully rolled back to save point a1b2c3d.
```

## Notes

* Rollback moves the ref, it does not delete the rolled-past commits. Those commits remain in the DAG and can be restored by rolling forward.
* The container is stopped during rollback to ensure a consistent materialization.
* Future commits on this branch start from the rolled-back point.

## Exit Codes

| Code | Meaning                                             |
| ---- | --------------------------------------------------- |
| `0`  | Rollback successful                                 |
| `1`  | Error (no commits, hash not found, container issue) |
