TestDisk includes TWO programs, PhotoRec and TestDisk. These programs can be used in the Terminal command line. These programs are intended for Mac users who are experienced and support personnel.
The powerful and free Data Recovery Software TestDisk is available! It was created to help you recover deleted partitions and/or make non booting disks bootable again if these symptoms are caused either by faulty software, viruses, or human error (e.g. accidentally deleting a Partition Table).
It will also locate accidentally deleted partitions (either Apple Partitions or the newer EFI Partitions and Windows MBR Partitons) to provide information that can be used to restore them using either the Apple pdisk command for Apple Partitions or the gpt command.
PhotoRec is a file data recovery program that can recover files from hard drives and CDRom. It can also recover video, documents, archives, and photos (hence its 'Photo Recovery name) from digital camera memories. PhotoRec doesn't care about the filesystem, but the underlying data. It will still work regardless of whether your media's filesystem is severely damaged or re-formatted.
PhotoRec can retrieve data from many filesystems, including FAT and NTFS.