# Roll back to an earlier version

A rollback makes an environment serve an earlier version. Every published version stays available, so a rollback is a deployment of a version that is not the latest. Nothing is rebuilt, and pages get the earlier version on their next load.

## Roll back an environment

To serve an earlier version:

1. In the portal, go to [**Web Agents**](https://auth.faustine.ai/go?to=%2Fweb-assistants) and select your agent.
2. In the agent's header, select the control that lists each environment with the version it serves. The **Deployments** dialog opens.
3. Under the environment, select the earlier version. The version the environment serves is marked **Live**.
4. Select **Yes, serve** with the version number to confirm.
5. Select **Apply changes**.

The header shows the earlier version next to the environment. In the dialog, the environment reads `1 version behind latest`, or the number of versions between the one it serves and the latest.

Each environment is rolled back on its own. To roll back two environments, select the version under both before you apply.

## What a rollback does not change

| Not changed | Consequence |
| --- | --- |
| The draft | The draft still has the changes of the version you rolled back from. The next publish includes them, so fix them in the draft first. |
| The version list | The later version stays in the **Versions** tab and can be deployed again. |
| Environment settings | Variable values, allowed domains and the debug sessions switch belong to the environment and stay as they are. |

## After a rollback of the release target

When the release target serves a version that is not the latest, the agent's header shows a **Deploy** button with the latest version and the environment's name. Leave it alone until the draft is fixed. The next publish is served on the release target again.

## Troubleshooting

| Symptom | Cause | Fix |
| --- | --- | --- |
| Applying fails for the environment | The earlier version reads a variable that has no default and no value on that environment. | Set the value in the **Variables** tab, then apply again. |
| A user still sees the later version | Their page loaded before the rollback and keeps the actions it loaded. | The page gets the earlier version when it loads again. |

## Next steps

- [Deploy a version to an environment](https://docs.faustine.ai/web-agents/deploy-a-version/): serve the fixed version when it is ready.
- [Read the logs](https://docs.faustine.ai/web-agents/logs/): find the conversations that ran on the version you rolled back from.
- [Versions, environments and deployments](https://docs.faustine.ai/web-agents/versions-and-environments/): how versions and environments relate.
