I’m sorry to hear that.
As you point out, it does overwrite the app:
If you ever had a live version, you should be able to restore from that (upgrade plan, then ‘Reset to live’) so it shouldn’t be lost. If you never deployed to live, then I don’t have any other suggestions.
Of course, hindsight is always useful, but everyone should take backups of their apps, even for more benign reasons (e.g restoring a page you deleted ages ago).