I was running Ubuntu 14.04 and Windows 7 in dual boot.
After upgradring to Windows 10, the PC would not boot (grub error) and the Linux partition appeared as unallocated in GParted (run from a Ubuntu live USB).
Here’s how I solved it.
1. Restore boot to Windows 10
Boot the PC with a Ubuntu live CD/USB and run boot-repair. Now your PC should boot directly to Windows.
2. Restore the Ubuntu partition
Boot with a Ubuntu live drive. Apparently testdisk will restore the ability to boot to Ubuntu but remove the ability to boot to Windows. So I used parted.
To find out where the lost partition starts and ends:
sudo parted /dev/sda unit s print
Then to restore it:
sudo parted
unit s
rescue
input start & end and see if it finds partition