Skip to content

Deploy history and rollback

LeafCloud keeps past deployments available so you can review history and roll back to a previous deployment.

To list the deployment history of a site:

Terminal window
leaf deploys --site my-cool-project

Output:

dep_01ha82f91m live 2026-10-23T02:40:12Z
dep_01ha7x90qp superseded 2026-10-22T19:15:04Z
dep_01ha6c12nm superseded 2026-10-21T11:02:55Z

If your account has only one site, the --site flag is optional. In projects with a leaf.toml specifying site = "...", that site is used.

With --json, the history is output as newline-delimited JSON, one schema 1 object per deployment:

Terminal window
leaf deploys --site my-cool-project --json
{"schema":1,"type":"deploys","data":{"created_at":1792723212,"deploy_id":"dep_01ha82f91m","status":"live","error":null}}
{"schema":1,"type":"deploys","data":{"created_at":1792696504,"deploy_id":"dep_01ha7x90qp","status":"superseded","error":null}}

If a deployment needs to be reverted, you can restore a previous deployment.

To revert to the deployment immediately preceding the active one, omit the deploy ID:

Terminal window
leaf rollback --site my-cool-project

Output:

✓ Rolled back my-cool-project to dep_01ha7x90qp

With --json, rollback returns a schema 1 object:

Terminal window
leaf rollback --site my-cool-project --json
{"schema":1,"deploy_id":"dep_01ha7x90qp","url":"https://my-cool-project.leafcloud.app","status":"live"}

To restore an older deployment from your history, pass its deployment ID:

Terminal window
leaf rollback dep_01ha6c12nm --site my-cool-project

Output:

✓ Rolled back my-cool-project to dep_01ha6c12nm

Rollbacks take effect across the Bengaluru and Delhi edges.