> ## 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 reset

> Reset the current branch to main's state.

# `graft reset`

Reset the current (non-main) branch to match main's current tip commit. The branch directory is replaced with main's tree.

## Usage

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

## Behavior

1. Resolve main's tip commit hash
2. Load main's tree entries
3. Stop the container
4. Materialize main's files into the current branch directory (overwriting everything)
5. Move the current branch's ref to main's tip
6. Start the container

## Example

```bash theme={null}
graft checkout experiment

# Make changes...
graft commit -m "experiment changes"

# Decide to start fresh from main
graft reset
```

```text theme={null}
Resetting branch experiment to main's save-point a1b2c3d...
Branch experiment reset to main (a1b2c3d).
```

## Notes

* This command only works when the active branch is not `main`
* The reset is destructive to the branch's working directory but the DAG history remains intact
* To recover a reset branch's previous state, roll back using the commit hash

## Exit Codes

| Code | Meaning                                             |
| ---- | --------------------------------------------------- |
| `0`  | Reset successful                                    |
| `1`  | Error (already on main, no commits, main not found) |
