If you formatted with the exact same size partition, and didn't write all kinds of files over it, you can recover. Just run fsck. There are different flavors of fsck. There is fsck.reiserfs, fsck.ext3, and so on. You want to do a "fsck.filesystem --rebuild-tree /dev/sda3", or whatever partition it is. You can run this from a boot cd, and I would recommend it, especially if it is the root partition.
for boot cd with many tools
For someone who isn't sure if this will work, it takes what seems like an eternity. You will probably have many files in "lost+found" directory. You can look through these and see where they go. Since all the files you really need can be identified by looking inside of them, you can just do a "cat filename | less". If the file looks like something you want, keep it. If you can't decide, just leave it there. If you know you don't need it, get rid of it.
I wouldn't be too hasty. Just take your time, and keep your wits about you. File systems are recoverable if you haven't written to them, or repartitioned. You just have to unscramble "lost+found".
I have every confidence you will back up from now on. I put two identical HDD's in each computer. Then, before I'm going to screw with anything major, I do:
dd if=/dev/sda of=/dev/sdb bs=4096 conv=notrunc,noerror
to create an exact image of sda on sdb. You do this from a boot disk, too. Make sure the if= is the intended source, and of= is the intended target. Then, if you mess up you can do:
dd if=/dev/sdb of=/dev/sda bs=4096 conv=notrunc,noerror
And write the good copy back to the messed up one and mess it up again, maybe. This way you have no fear, and you can really learn by taking huge risks. No matter what happens, you can just write the good image to your boot drive, and start over.
If you want to see what your system ram actually has in it:
dd if=/dev/mem of=/home/sam/memimage bs=1024
view the file memimage
See my post on learning the dd command.