You can manage the site history of sites that include code in the same way you manage sites without code. You can revert the site to a previous version.
Tip: Name your versions so you can easily find the version to revert to later.
This article explains why it is important to understand the implications of this restore.
You can revert the site to a previous version using:
Note: When working in a local IDE, you can connect your site to Github for more advanced version control.
When you revert to an older version of your site, the following elements are reverted to their previous states:
Keep in mind that data in both the Sandbox and Live databases don't revert to the previous state. This means that the data remain as in the current version and you can't recover deleted data by restoring a previous site.
When you restore to a previous version, the schema follows the version being restored. This means if you made changes in fields with the newer version, those changes might not exist in the older version's schema. You can add fields to the older version's schema as needed. The data is retained and becomes visible once the fields are added.