@Narayan I once experienced a corrupt SD card after camping and hiking up mountains in Italy’s Dolomites region. The SD card cost just ~35EUR, but the trip and the sweat were essentially priceless. I used http://www.cgsecurity.org/wiki/TestDisk to recover what could be recovered. Next, I used Adobe DNG Converter in batch mode to convert all the recovered files (Pentax PEF format) to DNG. I did that to filter out the hopelessly corrupt files from the usable ones. You could try that.
Never use the partition which contains the corrupted or deleted files! Don’t boot from it, don’t use it. Recover to a separate partition, preferably to separate disk if dealing with corruption (recovering to a separate partition on the same disk should be safe if dealing with deleted files, but dangerous when dealing with corrupted files/partitions/volumes/disks).