Thankyou for using Microsoft Q&A platform and thanks for posting your query here.
As I understand your query, you want to know how to rollback the changes to the previous version of deployment . Please let me know if that is not the case.
You can use inline powershell task for this requirement and try following command :
To redeploy the last successful deployment, add the -RollbackToLastDeployment parameter as a flag.
New-AzResourceGroupDeployment -Name ExampleDeployment02 `
-ResourceGroupName $resourceGroupName `
-TemplateFile c:\MyTemplates\azuredeploy.json `
-RollbackToLastDeployment
To redeploy a specific deployment, use the -RollBackDeploymentName parameter and provide the name of the deployment. The specified deployment must have succeeded.
New-AzResourceGroupDeployment -Name ExampleDeployment02 `
-ResourceGroupName $resourceGroupName `
-TemplateFile c:\MyTemplates\azuredeploy.json `
-RollBackDeploymentName ExampleDeployment01
For more info , kindly visit: Rollback on error to successful deployment
Hope it helps. Kindly consider accepting the answer as accepted answer helps community. Thanks