Data Recovery for Accidentally Erased Hard Drive
There is a product called DiskDrill that I have used with good success. You can use the product for free to see what it can find. To actually recover your files, you will need to purchase a license.
The key to a successful recovery is to immediately stop modifying the drive. You either need to get a new drive and connect your original drive via USB, or boot from external (USB) drive and run the recovery utility. The more you modify your drive, the less chance of recovery.
My suggestion is now is a good time to get a new SSD and convert that older drive into an external USB so you can create an image (through DiskDrill) of the drive for recovery and then when you are done, set it up as a time machine back up. A USB to SATA adapter can be had for less than $15 so this is a very cheap option.
Another alternative to the awesome TestDisk is GetDataBack, it's a paid software, but I used it successfully on hard drives that TestDisk could not recover. You can try the demo to see if the files are recovered, then buy the software to recover the files.
The additional killing feature compared to TestDisk is that it can read and understand the OS filesystem from parts to parts, whereas TestDisk needs the whole partition to be recoverable to recover your disk (or they provide PhotoRec for data scraping, but you lose all directory trees and metadata like filenames! Whereas GetDataBack can recover a directory tree even if the rest of the hard disk is corrupted).
Another one that had close results to GetDataBack but with some redundancy and GUI bugs was Easus DataRecovery Wizard Pro (it can also understand partial filesystems). Finally, you can also try Alsoft Diskwarrior for Mac, seems similar featurewise but never tried it.
You can also try using Secure Data Recovery Services or a similar data recovery service. You will have to send in your drive or your MacBook to them for service.
Do you have a Time Machine backup? If yes, you can recover your data from it. If not, why not!? Depending on how important your data is to you, you might want to consider a professional recovery service via Kroll Ontrack Date Recovery Service.
They also have do it yourself Data Recovery Software.
I'm not directly affiliated with Kroll Ontrack, just a satisfied customer of both the Recovery Service and Recovery Software I've used myself.