How do I recover my data/OS after accidentally writing over my main hard drive with an img file using dd?
If I was in the same or similar situation, this is what I'd try...

Using another Mac I'd download Yosemite from the App Store and then create a USB Installer.  Next I'd boot the Mac with the Yosemite USB Installer and install Yosemite to an External USB Drive, preferably a USB 3.0 HDD/SSD or even a large Thumb Drive.  Once the install to the External USB Drive is complete I'd boot the Mac from it and then download and install Ontrack EasyRecovery (on the external disk) then shutdown and move the External USB Drive to your MacBook Pro and boot from it. Then run Ontrack EasyRecovery and see what can be recovered.  If the trial shows promising results then purchase the product and recover as much of your User Data that you can.