> ## Documentation Index
> Fetch the complete documentation index at: https://docs.poly.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Deployments

> How to make changes to your agent and publish the new version to customers.

Your agent has a **Live** version. This is the version your customers interact with. You never edit Live directly.

Instead you work in a copy of the agent, called a **Branch**. It saves as you go, without affecting the Live version. When you are ready to push the changes to customers, you **publish**. This creates a new Live version, and from that moment it handles every customer conversation.

## Publishing

When you publish, your changes are **merged** onto Live. Merging means your changes are added on top of what is already there, rather than replacing it.

That matters when more than one person is working on a project. If a colleague publishes their Branch while you are still working on yours, your change is added on top of theirs. If you both changed the same thing, you are asked which version to keep before anything goes live. Nothing is lost silently.

## Rolling back a change

Every publish is saved as a version in Live's history. If a change goes wrong, you can roll back to an earlier version in one step.

![Deployments page Live history tab, listing published versions with the current one marked Live](https://mintcdn.com/polyai/UzNYVK3JXgtowp_7/images/deployment/deployments-live-history.png?fit=max\&auto=format\&n=UzNYVK3JXgtowp_7\&q=85\&s=74dde5ded08c83cdfdce0a6974f3467e)

Live history on the Deployments page, with every published version in order

**1. Open Live history on the Deployments page**

Every publish is listed there as a version.

**2. Choose an earlier version and roll back**

Live returns to that version in one step. Nothing else changes.

> [!TIP]
>
> Because publishing merges rather than replaces, a rollback cannot be silently undone by someone else's publish.

> [!NOTE]
>
> While an [experiment](https://docs.poly.ai/testing/experiments.md) is running, rolling back waits until you end it.

## Two ways to work

Every project can have as many Branches as you need, and any Branch can be split into **Sub-branches**. You decide which to use for each piece of work, depending on whether the change ships on its own or as part of a larger update.

| | **How it works** | **Best for** |
| - | - | - |
| [**Branches**](https://docs.poly.ai/environments-and-versions/branches.md) | Each person has their own Branch and publishes it when ready. Nobody waits for anyone else. | One person making a change, or a small team working on separate changes at the same time. |
| [**Sub-branches**](https://docs.poly.ai/environments-and-versions/sub-branches.md) | A team shares one Branch, splits the work into Sub-branches, and publishes everything together. | Several people building one update that ships as a package. |

![Branches and Sub-branches in Sandbox, one Branch in Staging, publishing onto Live](https://mintcdn.com/polyai/8AhCJDrELJ5yBVXl/images/deployment/deployment-model-light.svg?fit=max\&auto=format\&n=8AhCJDrELJ5yBVXl\&q=85\&s=533abea428e52b3f76804940f0368184)

Each has its own page. Start with Branches, because everything on that page applies to Sub-branches too.

## Terminology

| **Term** | **What it means** |
| - | - |
| [**Environment**](https://docs.poly.ai/environments-and-versions/environments.md) | Where your agent runs. Your project has more than one, so the version you are editing is never the one customers are using. |
| [**Live**](https://docs.poly.ai/environments-and-versions/environments.md#live) | The environment that runs the version of your agent your customers talk to. |
| [**Sandbox**](https://docs.poly.ai/environments-and-versions/environments.md#sandbox) | The environment where you build and test. Nothing here reaches a customer. |
| [**Staging**](https://docs.poly.ai/environments-and-versions/environments.md#staging) | An optional environment for testing a change the way a customer would experience it. |
| [**Branch**](https://docs.poly.ai/environments-and-versions/branches.md#what-a-branch-is) | A copy of the agent that you make your changes in. Usually each person has their own, or a team shares one and splits it into Sub-branches. Publishing merges it onto Live. |
| [**Sub-branch**](https://docs.poly.ai/environments-and-versions/sub-branches.md#what-a-sub-branch-is) | A copy made from a Branch, so a team can split one piece of work between them. It merges back into its Branch. |
| [**Publish**](#publishing) | Push your Branch to Live. Your changes are merged onto Live, and every publish becomes a version in Live's history. |
| [**Merge**](#publishing) | Join two copies of the agent into one. Your changes are layered on top of what is already there, so nothing is replaced. A Branch merges onto Live, and a Sub-branch merges into its Branch. |
| [**Roll back**](#rolling-back-a-change) | Put an earlier version of Live back. |
| [**Sync**](https://docs.poly.ai/environments-and-versions/branches.md#handling-an-out-of-sync-branch) | Pull in changes made to the parent since you started, so your copy is up to date. A Branch's parent is Live. A Sub-branch's parent is its Branch. |
| [**Out of sync**](https://docs.poly.ai/environments-and-versions/branches.md#handling-an-out-of-sync-branch) | The parent has changed since you started. You need to sync before you can merge or publish. |

## Related pages

> [card] [Branches](https://docs.poly.ai/environments-and-versions/branches.md)
>
> Everyone works in their own Branch and publishes when ready.

> [card] [Sub-branches](https://docs.poly.ai/environments-and-versions/sub-branches.md)
>
> A team shares one Branch and ships an update together.

> [card] [Environments](https://docs.poly.ai/environments-and-versions/environments.md)
>
> What Sandbox, Staging and Live are, in plain English.

> [card] [Compare changes](https://docs.poly.ai/environments-and-versions/diffs.md)
>
> See exactly what will change before you publish.

> [card] [Everyday practice](https://docs.poly.ai/learn/maintain/version-management.md)
>
> Hotfixes, seasonal updates and best practice, in the Academy.

> [card] [Environments and testing FAQ](https://docs.poly.ai/troubleshoot/faq-environments.md)
>
> Common questions about Sandbox, Staging and Live.

> [card] [Experiments](https://docs.poly.ai/testing/experiments.md)
>
> Run a Branch against Live on real calls and keep the winner.
