I have a 1 TB external harddisk where I recently installed Ubuntu onto. Before I had some backups there which I didn't want to lose. Therefore I created a new partition for Ubuntu. During this process I somehow must have changed the type of the backup partition from ext4 to swap (although I can't remember in doing so, but this is what gparted shows me). This new swap partition has never been used by the newly installed Ubuntu which has its own swap partition. Although I think chances are bad: Is there any way to get my data back from my backup (now swap) partition?
To clarify the situation, here's the current partition table of the device:
Partition Start End Size in sectors
1 * Linux Swap 0 32 33 12157 195 58 195312500
2 E extended 12157 214 24 47791 227 52 572461058
5 L Linux Swap 12157 214 26 12534 172 54 6053888
X extended 12534 172 55 17397 188 7 78125056
6 L Linux 12534 205 24 17397 188 7 78123008
X extended 17397 188 8 47791 227 52 488282112
7 L Linux 17397 220 40 47791 227 52 488280064
If what you say above is 100% sure then use testdisk.
aptitude install testdisk
If the partion was never used, it is totally recoverable because the data is untouched and the partition size is also kept, you just just use fdisk and change the partition type back to ext:
However the "I somehow must have changed the type of the backup partition from ext4 to swap" sounds more like that you have deleted/recreate the partition, the installer does not provide a simple way to modify partition types. testdisk might still help but I wouldn't expect a full recovery.