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
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
project_name | Annotated[str, Field(description='Name of the Bridge Town project.')] | Yes | — | |
path | Annotated[str, Field(description="Project-relative file path (e.g. 'model/revenue.py'). Omit to operate on the whole project.")] | Yes | — | |
target_sha | Annotated[str, Field(description='Git commit SHA to roll back to.')] | Yes | — | |
commit_message | Annotated[str, Field(description='Git commit message for the rollback commit. If omitted, a default is generated.')] | No | '' | |
branch | Annotated[str, Field(description="Branch to inspect. Defaults to the project's default branch.")] | No | '' | |
expected_current_sha | Annotated[str, Field(description='Expected SHA of the current HEAD for optimistic concurrency. Fails if the branch has changed.')] | No | '' | |
dry_run | Annotated[bool, Field(description='Preview the rollback without creating a commit.')] | No | True | |
confirmation_token | `Annotated[str | None, Field(description=‘Token required to confirm rollback (returned by a dry run).’)]` | No | None |
Returns
Section titled “Returns”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.
Example
Section titled “Example”Tool Call
Section titled “Tool Call”{ "name": "rollback_version", "arguments": { "project_name": "forecasts", "model_name": "revenue", "target_sha": "0123456789abcdef0123456789abcdef01234567", "commit_message": "rollback: restore previous revenue model" }}Response
Section titled “Response”{ "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.