Skip to content

rollback_version

Restore a project file to the bytes it had at a previous version (commit SHA). Pass path as a project-relative file path (e.g. model/revenue.py, README.md, data/seed.csv, assets/logo.png). This creates a new commit — it does NOT rewrite history. Use list_versions to find the commit SHA you want to restore. Optionally specify a branch to restore on a scenario branch instead of the default branch.

destructive

NameTypeRequiredDefaultDescription
project_nameAnnotated[str, Field(description='Name of the Bridge Town project.')]Yes
pathAnnotated[str, Field(description="Project-relative file path (e.g. 'model/revenue.py'). Omit to operate on the whole project.")]Yes
target_shaAnnotated[str, Field(description='Git commit SHA to roll back to.')]Yes
commit_messageAnnotated[str, Field(description='Git commit message for the rollback commit. If omitted, a default is generated.')]No''
branchAnnotated[str, Field(description="Branch to inspect. Defaults to the project's default branch.")]No''
expected_current_shaAnnotated[str, Field(description='Expected SHA of the current HEAD for optimistic concurrency. Fails if the branch has changed.')]No''
dry_runAnnotated[bool, Field(description='Preview the rollback without creating a commit.')]NoTrue
confirmation_token`Annotated[strNone, Field(description=‘Token required to confirm rollback (returned by a dry run).’)]`NoNone

Returns a structured object. Top-level fields:

  • project (string)
  • path (string)
  • restored_to_sha (string)
  • new_commit_sha (string)
  • commit_message (string)

See the response example below for the full payload shape.

{
"name": "rollback_version",
"arguments": {
"project_name": "forecasts",
"model_name": "revenue",
"target_sha": "0123456789abcdef0123456789abcdef01234567",
"commit_message": "rollback: restore previous revenue model"
}
}
{
"project": "forecasts",
"path": "model/revenue.py",
"restored_to_sha": "0123456789abcdef0123456789abcdef01234567",
"new_commit_sha": "abc1234def5678901234567890abcdef12345678",
"commit_message": "rollback: restore previous revenue model"
}
  • Module: Versions
  • Requires authentication via API token or Auth0 JWT.