This question already has an answer here:
I had a serious problem during my Ubuntu 14.04 installation. I had a Windows 7 partition and a separate partition to install Ubuntu, where I already had Ubuntu 12.04 installed.
During the Ubuntu installation, I was asked if I wanted to either "Upgrade Ubuntu" or install it fresh new. When I chose to install it (which would delete the existing Linux installation along with all its files), I thought it would delete files only on the existing linux partition. However, for my surprise, it deleted all the existing partitions and created a single one for the new Linux install.
I had some backup of my data, but some very important documents were lost due to this repartitioning and formatting of my hard drive.
I know that there was a way to avoid this during installation, but it did not seem very intuitive to me. In previous versions it was easier to install Ubuntu alongside with Windows without risking all my data.
So, what I want to know is... Is there a way to recover my data, even if the partition has been deleted and reformatted? The partition I want to recover data from was NTFS.
I am aware that I may not be able to recover everything, but I want to try to recover as much data as I can. I read testdisk might be useful... but I don't know how it could be used in recovering files from a partition that has already been formatted.