If a file got overwritten, I don't think there's anything you can do. :/
But here's some more suggestions to help prevent this from happening in the future:
1- Keep at least 3 different custom folders. Play, Dev (your files), and Test (other people's files)
2- Never paste anything into Dev. This way you'll always have a backup of the files you're working on.
3- Never open UIBuilder in Play. Make changes in Dev or Test and copy to Play. (You don't want get started with something in-game and then find out the raid window you were working on won't open.)
Along with Kosmos's suggestion about making backup copies with each version, that should help make sure this doesn't happen to you again.
Sorry you had to find out the hard way.