I have successfully used TestDisk
to recover and restore all data and files from formatted HDDs. Follow the TestDisk wiki and examples. I did not do anything with the corrupt/formatted HDD until I installed it to the good computer and ran TestDisk - doing so increases the chances the backup master boot record (MBR) will be over-written and unrecoverable. I put the formatted HDD into an operating computer, launched the OS on the good system, opened TestDisk, found and restored the master boot record, then went on to that to restore the HDD.