Skip to main content

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

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

graft rollback
? 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

graft rollback a1b2c3d
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

CodeMeaning
0Rollback successful
1Error (no commits, hash not found, container issue)