# Rollback a Deployment

## ![](/files/RXx59Hu9EyPCisSQ0YzA) Overview <a href="#what-is-rollback" id="what-is-rollback"></a>

Rolling back a deployment reverses the metadata changes from a completed deployment. The Rollback feature:

* Utilizes the pre-deployment backup snapshot stored by Deployment.
* Restores components to their original state.
* Ensures stability after a failed or problematic deployment.

Rollback is crucial in production environments where deployment errors must be rapidly corrected.

{% hint style="info" %}

#### Best Practices

* Always **validate** and test before deploying to minimize the need for rollbacks.
* **Rollback** all changed components if the deployment caused major issues.
* Use rollback **quickly in Production** to restore stability.
* Review rollback logs to confirm every component was successfully reverted.
* After rollback, re-validate the branch before redeploying.
  {% endhint %}

## Rollback a Deployment <a href="#best-practices" id="best-practices"></a>

{% stepper %}
{% step %}

### Select Deployment

{% hint style="info" %}
Only Deploy jobs with a status of **Completed** can be rolled back.
{% endhint %}

1. Click **Code** from the left sidebar menu.
2. Select a branch from the list.

   <div align="left"><figure><img src="/files/FL5EkId5x6K6pzlcHhhG" alt="" width="563"><figcaption></figcaption></figure></div>
3. Click the **Activities** tab.
4. Click the completed **Deploy** job to rollback.

   <div align="left"><figure><img src="/files/8GP0s03Q5xshXZpLiij6" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### Rollback

When performing a Rollback, you'll see a list of all components altered during deployment. You can then choose which components to revert.

{% hint style="info" %}
If the **Rollback** button isn't visible, then the Deploy job can't be rolled back.
{% endhint %}

1. Click **Rollback** in the right corner of the Deploy job status page.

   <div align="left"><figure><img src="/files/vZtPC6jJTS5o93yKW1pt" alt="" width="563"><figcaption></figcaption></figure></div>
2. Click **Add** for each branch component to revert to the pre-deployment backup.
3. (Optional) Click **Add all** to add all components.
4. Click **Run** to start the rollback.

   <div align="left"><figure><img src="/files/CXJ7sFVQKcmQ07kd6jg9" alt="" width="563"><figcaption></figcaption></figure></div>
5. After starting the Rollback job, it will be displayed on the **Activities** tab.

   <div align="left"><figure><img src="/files/NC30kwaG26J1nmWUXSD4" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}
{% endstepper %}

## Rollback Results <a href="#how-to-run-rollback" id="how-to-run-rollback"></a>

{% stepper %}
{% step %}

### View Results

1. Click the **Activities** tab.
2. Check that the **Rollback** job status is **Completed**

{% hint style="info" %}
If an error occurs during the Rollback job, its status will change to **Exception**. Review the Rollback job log to identify the errors.
{% endhint %}

<table><thead><tr><th width="159.6666259765625">Job Status</th><th>Description</th></tr></thead><tbody><tr><td><strong>Queued</strong></td><td>Job is created and waiting to run.</td></tr><tr><td><strong>In Progress</strong></td><td>Job is running.</td></tr><tr><td><strong>Completed</strong></td><td>Job completed successfully.</td></tr><tr><td><strong>Exception</strong></td><td>Job completed with errors.</td></tr></tbody></table>

3. Click the **Rollback** job.
4. The **Rollback** results page lists the job information and a detailed log
   {% endstep %}
   {% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flosum.com/devops/code/branch-actions/rollback-a-deployment.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
