Hi @FreyrSecurity You need to connect with shopify support and the theme support they can help you in this matter, you will not be able to find the solution in the community, Both the support will definitely provide you the solution that will work well for you and you will not loose your custom code.
Hopefully it will help you. If yes then Please don’t forget hit Like and Mark it as solution!
Best Regards
Sahil