# basemodo rollback

Make an earlier Deploy live again, as a new Deploy.

```sh
basemodo rollback [OPTIONS] <DEPLOY>
```

Nothing is built: the new Deploy runs the earlier one's image, with the App's Secrets as they are now, and waits until it answers HTTP. An App keeps the images of its live Deploy and the two before it, so a Deploy further back is refused, as is one from before a Security Update rebuilt the App, whose image has the vulnerability: deploy its Source again instead, as a new build.

## Arguments

- `DEPLOY` (required): The Deploy to make live again: its id, as `basemodo deploy --json` prints it (`deploy.id`). It must have gone live once.
- `--approval <ID>`: The Charge Approval an Admin approves on basemodo.com, as a refused rollback gave it, when the Deploy's workers go beyond the Always On Apps the Workspace pays for: wait until it is approved, then roll back with it.
- `--allow-public`: Open the paths the Deploy's manifest adds to (or widens in) `public_paths` or `[callers] paths` beyond the live Deploy's, as `deploy --allow-public` does: only the Owner (an Admin, for a Workspace's App) may, and an agent asks the person first. Without it, such a Rollback is refused naming the paths.

Like every command, it also takes the [global options](https://basemodo.com/docs/cli#global-options) `--json` and `--api-url`.

## Examples

Make an earlier Deploy live again (its id from basemodo deploys):

```sh
basemodo rollback 0b8f6a52-3f0e-4c1e-9a57-5d1c2e7f9a10
```

Roll back to workers beyond the Always On Apps paid for, once an Admin approved it:

```sh
basemodo rollback 0b8f6a52-3f0e-4c1e-9a57-5d1c2e7f9a10 --approval 6f1d0c8e-3b9a-4f2e-8d7c-1a2b3c4d5e6f
```

## Output

With `--json`, it prints {"url", "app", "deploy"}, as deploy prints it; progress events on stderr. Run by an agent, it waits at most 45 seconds, as deploy does: a rollback still starting then answers with "next", which says to call status until its latest_deploy is live or failed. A Deploy from before a Security Update rebuilt the App is an error with code deploy_before_security_update; one whose image was deleted, with code deploy_image_deleted. Workers beyond the Always On Apps a Workspace pays for ask an Admin for a Charge Approval, as deploy does: with --json or no terminal, an error with code charge_required, its "charges" and its "approval"; --approval waits until it is approved, then rolls back.

## From an agent

Basemodo's [MCP](https://basemodo.com/docs/mcp) serves it as the tool [`rollback`](https://basemodo.com/docs/mcp/tools/rollback). It changes things, so an agent's client may ask you before it runs. Its arguments are the command's, named as JSON keys: `deploy` (text), `approval` (text), `allow_public` (flag). It answers what the command prints with `--json`.

## Explained in

- [Getting started](https://basemodo.com/docs/getting-started)
- [Deploying](https://basemodo.com/docs/deploying)