If you have changed /Templates, /Sections or /Snippets then you are able to do undo the changes.
Go to the file in which you have made changes. Click on Older versions
Then you will find dropdown like this.
Select the date and time appropriately and click on save.
Shopify already features to backup files to your version (date) you want to backup. Please take a look at our screenshot here: https://prnt.sc/116nkrj
Hope this information is useful.
Ryder here from the Social Care Team at Shopify. Thanks for posting! It sounds like you made an edit to your theme's code and are wanting to revert it to the older version, is that right?
This can be done by going into your Admin and clicking on Online store > Themes in the lefthand menu. Next to the theme that you edited, click on the Actions dropdown menu and select Edit code:
Then you'll want to go into the template that you edited and click "Older versions" next to the
This will show you what older versions of the template are available to revert back to:
You can also find these instructions in this guide. To simplify this process in the future, I recommend creating a duplicate of your theme before making edits, allowing you to simply publish the unedited copy of your theme if need be.
I hope this helps! Please let me know if there's anything I can clarify.