# Rolling Back a CI Job

{% hint style="info" %}
For the best experience, set your browser zoom to **80%** in Chrome or Firefox.
{% endhint %}

The **Rollback** feature enables you to revert a deployment if issues are detected post-deployment or if unintended changes were introduced.

***

### How to Roll Back a Deployment <a href="#how-to-roll-back-a-deployment" id="how-to-roll-back-a-deployment"></a>

This section explains how to roll back a deployment in your CI jobs. The goal is to restore a previous release or deployment state.

***

#### Prerequisites <a href="#prerequisites" id="prerequisites"></a>

* The **Rollback** checkbox must be selected when creating the CI job.

***

#### Steps <a href="#steps" id="steps"></a>

1. Navigate to the **CI Job Results** screen.
2. Select the deployment label you want to roll back.
3. Click the **Rollback** icon: ![](/files/rLEs80bY2irxy1VpwDpA)

   <figure><img src="/files/zN1vSVG0THQcZVFTBwGi" alt="Rollback Icon Location"><figcaption></figcaption></figure>
4. Under **API Supported > Constructive Changes**, you’ll see the list of metadata components from the original deployment. All are selected by default.

   <figure><img src="/files/cOn2TaUexRKdTzV402KM" alt="Constructive Changes Selection" width="526"><figcaption></figcaption></figure>

   <figure><img src="/files/imLheBcFAhE50l5cPOya" alt="Rollback Metadata Overview"><figcaption></figcaption></figure>
5. In **Choose your Pre/Post Destructive Changes**, you can mark metadata present in the destination but absent in the source for deletion. These deletions are logged in the **Rollback Iteration Log**.

   <figure><img src="/files/HBaW1s0rFmpebsQLHhPq" alt="Destructive Changes Selection"><figcaption></figcaption></figure>
6. Choose a method for destructive changes:
   * **Post Destructive Changes**: Deletes components *after* deployment.
   * **Pre-Destructive Changes**: Deletes components *before* deployment starts.

{% hint style="info" %}
**Note:** For active **Flow** metadata, you must include the version number. See [FlowDefinition documentation](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_flowdefinition.htm) for details.
{% endhint %}

7. The **API Un-Supported** section lists metadata types unsupported by the API. You can manually include these as pre or post-destructive changes.

   <figure><img src="/files/uhoIM7SYIaA8UvtJxsQM" alt="Unsupported API Components"><figcaption></figcaption></figure>

{% hint style="info" %}
**Caution:** Avoid using unsupported API components in rollback, as they may cause rollback failures.
{% endhint %}

***

### Additional Deployment Options

Available configuration options before rollback:

* **Validate Only**: Run a dry-run validation without performing the actual rollback.
* **Deploy Purge on Delete**: Permanently deletes components instead of moving them to the Salesforce Recycle Bin.
* **Ignore Warnings**: Continues rollback even if warnings are encountered.

<figure><img src="/files/EQtxLwZe4BvcAaA2h0py" alt="Additional Rollback Options"><figcaption></figcaption></figure>

***

### Apex Test Level

Select an **Apex Test Level** to validate your rollback deployment.

* For details, see [Apex Unit Tests](/product-guides/arm/arm-features/deployment/apex-unit-tests.md).

<figure><img src="/files/7DFAlgI5PacBwDWcgnOM" alt="Apex Test Level Selection"><figcaption></figcaption></figure>

***

### Final Step

9. Click **Rollback** to initiate the process.
10. Once completed, the rollback appears in the **CI Job Results** screen, tagged accordingly. From there, you can:

* View rollback reports
* Download the rollback package
* Re-deploy the rollback if needed


---

# 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://knowledgebase.autorabit.com/product-guides/arm/arm-features/automation-and-ci/ci-job-rollback.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.
