I accidentally erased my hard drive in my 2010 MacBook Pro that had all of my information, photos, contacts, you name it... is there any way I can recover my data that was on my MacBook before I erased anything? I'm in desperate need of help to recover all my files.
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.
I just spent the weekend using testdisk and photorec on a dying external drive for a friend.
Testdisk itself is for a drive that is mostly recognizable (your case I think). photorec is for desperate circumstances. Neither will work if you actually wrote zero's across the drive as opposed to an accidental reformat, which doesn't actually wipe the drive.
Testdisk tries to read the underlying filesystems, whereas photorec just blindly looks across the disk for file headers that it recognizes, and then it assumes the file is contiguous.
In your case, I would give testdisk a shot first. You can either download it for MacOS, or use a rescue cd: http://www.cgsecurity.org/wiki/TestDisk_Livecd