I have just gotten a Developer edition org. It's also my Dev Hub. I'm planning to push changes from code that I've been developing with scratch orgs. How do I restore the Developer org to a previous state after pushing changes? Thank you


Generally speaking, you don't, and don't have to.

If you intend to package your code and are using 2GP, your code is never pushed to the Dev Hub. Your version control system is the source of truth.

If you intend to package your code and are using 1GP, your code would be pushed to your packaging org. The Dev Hub cannot be your packaging org.

If you're developing customizations to be deployed to your company's production org and you are using a separate Dev Hub, your Dev Hub would be distinct from your path to production and wouldn't receive code pushes

More generally, there isn't a way to revert an org to a previous state. You can get closer by scripting deployments from your version control and using destructive deployments to remove components that are no longer required, but it's tedious to say the least and there are some changes you can deploy into an org that are quite tricky to reverse.

You'll generally want to design your pipeline to avoid this necessity (by using scratch orgs first and foremost) as much as possible.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.