function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Taha HaiderTaha Haider 

How to Rollback deployment?

How can we rollback the deployment from CLI(package.xml file).
Is there any possibility that we can rollback the deployment in production.
ANUTEJANUTEJ (Salesforce Developers) 
Hi Taha,

>> https://salesforce.stackexchange.com/questions/123758/how-to-roll-back-a-code-deployment-from-sandbox-to-production

As mentioned in the above link there is no OOB functionality for this however you can have a backup as mentioned.

I am adding the best answer for quick reference:
 
Salesforce doesn't provide this functionality out of the box. But you can keep the old code backup and when needed revert back your code from the backup. to keep the old code backup you can use eclipse or Mavens mate. You can keep the backup in your system and if anything goes wrong. You can deploy the code.

Or else you can take help of github. Keep your code repository their and manage your code

Or you can use third party apps available on app exchange like flosum or many other apps are there (most of them are paid apps and I haven't use them much).

But I personally suggest to go with Eclipse or github. You can't redeploy the old change set again so you will not get any help from there too.

Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.  

Thanks.