Search Modaic documentation

Find a Modaic guide or API reference

Reference›API›models

Roll back a branch

Restore a branch to the state of an earlier commit. The rollback is itself a new commit whose files are the target's, so model.json comes back with the checkpoint, questions, and metrics it had at that commit, and gepa.json returns if the target had one. History is preserved; nothing is rewritten. Repository write access is required.

POST/v1/models/{modelId}/rollbacks

Authorization

Authorizationstringrequired

Send a Modaic bearer token in the Authorization header.

Parameters

modelIdUUIDrequired

Model repository ID.

branchstringrequired

Branch to move.

targetCommitShastringrequired

Commit whose files become the branch head again. Find it with List commits or from an alignment's resultCommitSha.

expectedHeadShastringrequired

The branch's current head. If it has moved, the request fails with 409 expected_head_mismatch and nothing changes.

messagestring

Commit message for the rollback.

Response

commitShastringrequired

The new head.

branchstringrequired
previousShastringrequired

The head before the rollback.

This is how to recover an alignment that a later update overwrote: list the commits, find the alignment's commit, and roll the branch back to it. New decisions then record the restored checkpoint again.

Was this page helpful?