How to Recover Data from Memory Card

Memory cards such as micro SD card, CF card are the most popular removable drives that are used for camera, mobile phone. It can easily store all kinds of data such as pictures, music, videos, documents etc. But what if you accidentally lose one or more files from digital media such as camera, mobile phone SD card, but for some reasons you have to format memory card to resolve the problems and lost all the data? Is there are ways to undelete or repair files from the corrupted memory card?