My company has provided me a scratch org for 30 days.

I made many changes in it but now I don't want those changes. I can manually try deleting it but it will take lots of time. I don't even remember all the changes I made.

So, Is there any sfdx command or any way through which i could reset my scratch org without contacting my admin?


The whole deal of sfdx is that you don't reset scratch orgs - you delete them and create new one. Initially we had our admin use a script to distribute new scratch orgs on request / weekly over slack. Now Salesforce lets add up to 5 people to dev hub so we can do it ourselves.

With scratch orgs you don't need to remember what changes did you made. Just create a new branch in git (git checkout -b temp_org) and pull your changes from scratch org (sfdx force:source:pull). Switch authorise a new org and push the source there (sfdx force:source:push -u new@org.username).

Of course it's easier said than done - you do need to setup your sfdx package first!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy