It’s the perfect nightmare and everyone do all his best to avoid it but sooner or later it happens.
Loosing data from a hard disk or a USB device is more common than you can image and everyone has experienced it!
Windows has different commercial solutions available to recover data and partitions but, if you use Linux, you need something different.
The best solution I found for Linux is an old but current article by Lifehacker.au that I strongly recommend if you are experiencing this kind of problems and want to solve them.