# rollback()

Canonical URL: https://developers.iagenify.com/sdk/ref/host/rollback/
Language: en

`host.rollback(deployId) → Promise<Deploy>`

Puts an earlier deploy back online. It repoints a version; it does not rebuild anything.

Status: POST · instant · a complete return

```javascript
const [, previous] = await host.deploys();   // the one before the current
await host.rollback(previous.id);
```

## It is a complete return {#complete}

Because a deploy replaces the whole asset set, going back to one restores exactly what it held — files that appeared since are gone, files that were removed come back. There is no partial state.

## Nothing is rebuilt {#no-rebuild}

> **It repoints at bytes that already exist**
>
> Which is why it is instant, and why it works even when the code that produced those bytes is long gone. A rollback is the fastest fix there is for a bad deploy.

## current follows {#current}

`host.current` becomes the deploy you rolled back to, and the one you rolled back from stays in the history — rolling forward again is the same call.

## Domains and the certificate are untouched {#domains}

The address, the attached domains and the certificate belong to the host, not to a deploy. A rollback changes what is served and nothing else.

## In a workflow it is still a publication {#approval}

It changes what the public internet sees, so the agent's and the workflow's approval rules apply to it as they do to a deploy.

- [deploys()](/sdk/ref/host/deploys): Finding the identifier.
- [deploy()](/sdk/ref/host/deploy): Putting files online.

```python
previous = host.deploys()[1]   # the one before the current
host.rollback(previous["id"])
```
