Coregit
API Reference

Snapshots

Create named restore points and roll back branches.

Create Snapshot

POST /v1/repos/:slug/snapshots
{
  "name": "before-refactor",
  "branch": "main",
  "metadata": { "reason": "pre-refactor safety" }
}

Captures the current head of the branch as a named restore point.

List Snapshots

GET /v1/repos/:slug/snapshots

Get Snapshot

GET /v1/repos/:slug/snapshots/:name

Delete Snapshot

DELETE /v1/repos/:slug/snapshots/:name

Restore Snapshot

POST /v1/repos/:slug/snapshots/:name/restore
{
  "target_branch": "main"
}

Resets the target branch head to the snapshot's commit SHA. This does not delete commits — you can always create a new snapshot before restoring.

On this page