Skip to main content
All CollectionsCompare and deploy metadataComparisons, history and deployments
Rolling back a deployment made with Compare and deploy
Rolling back a deployment made with Compare and deploy

Perform either partial or full rollback for any metadata deployment made with 'Compare and deploy'

Mateusz Kochanowicz avatar
Written by Mateusz Kochanowicz
Updated over a month ago

Note if you are using Gearset Pipelines:
If you are looking for instructions on fixing something you have deployed through your Pipeline, please see this article:
Edit or fix a user story in progress in pipelines
If you are looking for instructions rolling back (reverting) the changes deployed through Gearset Pipeline, you should follow the guidelines in this article:
Rollback with Gearset pipelines

Rollback for deployments made via Compare and deploy

With Gearset, you can easily roll back any deployment made through 'Compare and deploy' in a few clicks, with support for both full and partial rollback.

License requirements: Rollback feature is available for Gearset users holding Deployment Teams and Enterprise licenses.

How rollback works in Gearset

Gearset's rollback works thanks to our automatic org snapshots.

Whenever you run a deployment in Gearset, a snapshot of your target org's metadata is automatically saved just prior to deployment.

This means if you ever need to roll back changes, Gearset will run a comparison between the stored snapshot metadata and the org's current live state. This will highlight what changes have been made since the snapshot was taken, and let you selectively roll back any (or all) of those specific metadata changes.

Rollbacks take advantage of Gearset's unique problem analyzers to identify and include any required dependencies for the rollback to succeed. 

There's no limit to how far back you can go to perform a rollback, with the caveat that if you try to roll back a deployment from some time ago, you may see a large number of detected changes between the snapshot and the org's live state.

Rollbacks can also be performed for source control in exactly the same way.

How to roll back a deployment with Gearset

  1. On your Deployment history page click on the deployment you want to roll back , and then click Roll back...

You'll see a pop up window with additional information on how rollback feature works:

Select Start rollback comparison to initiate a rollback deployment.

Note: Gearset does not rollback the state of your org all the way to a specific moment in time. Instead, we only rollback the changes deployed as part of that specific deployment you're selecting to perform rollback on.

Gearset will run a comparison between a snapshot of the target environment - we saved a snapshot of the environment before any of the changes were deployed to the target.

Gearset will then compare the saved snapshot with the target's current live state.

Your item(s) will be pre-selected for the rollback, but you can customize the selection.

On this example, Sales_Escalation Compact layout on Account object was originally deployed to Test2 org.

And now we've decided to revert (roll back) this change, and remove the deployed Compact layout.

2. After selecting the items to roll back, click Next . You'll be taken to the problem analysis screen. This is where Gearset checks for any possible issues with this rollback deployment.

3. If there are no issues (or once you've accepted problem analyzer suggested fixes in Issues with automatic fixes tab), you can select Pre-deployment summary.

4. On the next page you can decide to Validate deployment to confirm there indeed won't be any issues with the deployment, and then deploy the package.

Alternatively, you can use Deploy now option to complete the rollback process.

5. If you decide to run the validation, in case you want to be on the safe side, Gearset will validate your deployment.

Once successful, you'll be presented with Deploy now option and the validation confirmation page.

And when you select Deploy now, you'll see a pop up notification to let you know that once the deployment starts, you can't cancel it.

But if the deployment fails, the target will be rolled back to its original state.

A successful rollback deployment in the end will bring you to a Deployment summary page, where you can also checked the Deployed metadata items in a separate tab.

Where to locate the history of my rollback deployment?

After successfully rolling back your changes, your deployment will be stored in your Deployment history page, tagged as a rollback.

You need to click on your deployment to see the tag, which would normally say Type: Rollback - this indicates that your deployment type is a rollback deployment.

From there, you can view the usual PDF deployment report, download the package, and even roll back the rollback deployment if you wish!

A note if you are rolling back/restoring a deleted component:
The Salesforce data for that item and any linked metadata objects that are not requirements for that object to deploy successfully and will not automatically be deployed unless they were included in the original deployment.

To restore the data for that component please see our article on data restoration.

Did this answer your question?