The files that have been overwritten cannot be restored unless you restore them from a backup.
The issues you are describing seem to be related to missing best practice procedures. For example: Before you start something new, clean up the old stuff (e.g. remove the previous content). Before you apply a change to an existing configuration or website, have a backup. Etc.