If you have formatted the memory card due to any error encountered and asked to format? Nothing to worry, you can do memory card recovery after format error using good memory card recovery software. There are many memory card recovery software that are available, you just need to download good one and recovery your lost data from the memory card.
That's a bummer, but like austin447 said you have software to recover it. I use the sandisk w/ RescuPRO that already come with recovery software. The thing is when you buy a 4 gig card, it's actually larger than 4 gigs. The additional partition is exactly for recovering the data that may have been inadvertently deleted/formatted. But, it acts as a buffer with a FIFO(First In First Out) system. So the extra partition designated for recovery bumps out the oldest data as new data comes in - it's designed as such as it can only store so much. So what you can recover is dependent on how far back in the memory stack you are trying to recover.
The later ones are recoverable, and the older ones(if bumped out) may not be. Good luck!
Even without such a buffer, formatting only rewrites the "file allocation table", which is an index of where files are on the device. With no files allocated, the card appears empty after formatting, but the data is still sitting where you left it, albeit no longer indexed. Recovery software can search through the device and find patterns like the beginning and end of a jpg, and guess where the files might have been. Most of the time it's very successful. Once the allocation table is clear however, any space is up for grabs, and some of the old data may be corrupted or completely overwritten. So, if you think you'll need to do a recovery, stop using the card immediately and only let the recovery software touch it.