Recovering data from hard disk after an accidental Ubuntu reinstallation

Exactly the same thing happened to me. I managed to recover all my data with testdisk.

In my case I had 2 partitions - the Ubuntu install formatted my drive and deleted my second partition with all my data. I simply re-enabled the partition (I think I set it from deleted to logical..) and I could access everything from Ubuntu again. It was also possible to copy the files from within testdisk to another drive/partition.

Good luck!