Generally when it says deleted all the data it doesn't actually refer to delete. Your partition has just been labeled for overwrites with use. That is, the information has been classified as worthless and will be overwritten when more useful data needs to be stored(i.e. your new data like installing Ubuntu) So the more data you use the more of your 'supposed deleted data' is going to get overwritten.
Sadly there is no way to completely reverse the process, But
There are many tools for recovery of deleted data
http://www.cgsecurity.org/wiki/TestDisk
Command line, could be a challenge if you aren't comfortable &
http://www.cgsecurity.org/wiki/PhotoRec
Are some of the tools you can use
Do note this is only if the data is still present in some form hidden/ghost and has not been corrupted by overwriting of the bytes.
Some of the Steps you can perform Using testdisk:
1) Under Unix/Linux/BSD, you need to be root to run TestDisk (ie. sudo testdisk-6.13/testdisk_static). You must have installed testdisk in the first place using, in my case it was
tar -xjf /<path to>/testdisk-7.0.linux26-x86_64.tar.gz
cd testdisk-7.0.linux26-x86_64
./configure
make
sudo make install
After you download it, in that order.
Then you can try the following recommended steps from testdisk's intruction webpage:
1) To repair a filesystem not listed by TestDisk, run testdisk device, i.e.
testdisk /dev/mapper/truecrypt0
or
testdisk /dev/loop0
to repair the NTFS or FAT32 boot sector files from a TrueCrypt partition. The same method works with filesystem encrypted with cryptsetup/dm-crypt/LUKS.
To repair a filesystem on top of a Linux RAID device.
testdisk /dev/md0
2) Press Create in the next step, if it gives an error opt for 'No Log'
3) All hard drives should be detected and listed with the correct size by TestDisk:
Use up/down arrow keys to select your hard drive with the lost partition/s.
Press Enter to Proceed.
4) Partition table type selection
TestDisk displays the partition table types.
Select the partition table type - usually the default value is the correct one as TestDisk auto-detects the partition table type.
Press Enter to Proceed.
5) Current partition table status
TestDisk displays the menus (also see TestDisk Menu Items).
menus
Use the default menu "Analyse" to check your current partition structure and search for lost partitions.
Confirm at Analyse with Enter to proceed.
Now, your current partition structure is listed. Examine your current partition structure for missing partitions and errors.
Analyse
The first partition is listed twice which points to a corrupted partition or an invalid partition table entry.
Invalid NTFS boot points to a faulty NTFS boot sector, so it's a corrupted filesystem.
Only one logical partition (label Partition 2) is available in the extended partition. One logical partition is missing.
Confirm at Quick Search to proceed.
6) Quick Search for partitions
TestDisk displays the first results in real time.
quick search
During the Quick Search, TestDisk has found two partitions including the missing logical partition labeled Partition 3.
first results
Highlight this partition and press p to list your files (to go back to the previous display, press q to Quit, Files listed in red are deleted entries).
All directories and data are correctly listed.
Press Enter to proceed.
7) For the rest of the steps I highly recommend you visit the testdisk website as there are many exhaustive steps with complete details
http://www.cgsecurity.org/wiki/TestDisk
testdisk
makes a lot of sense. However, if your NTFS partition is corrupted it won't work. Check out my answer here in that case: http://askubuntu.com/a/776317/271 – Andrea Lazzarotto Jun 01 '16 at 10:53