Before you do anything else with the card, download
PhotoRec to your PC. Turn the phone off and put the card into an adapter and plug it into your PC (Linux, Mac or PC - there are versions of the program for all 3). The instructions are at
PhotoRec Step By Step. The program is free (even though some people would pay a lot of oney just to run it once to retrieve a valuable file) and it'll recover any file still on the memory chip of the card. (The card is a little controller - usually in your situation, the controller gets messed up. PhotoRec bypasses the controller, so it should recover your files.)
It won't recover file names - they're gone. You'll get names like f00001.jpg. You'll have to look at the files and rename them. (If you get an EXIF reader or editor [google
exif reader or
exif editor], you can look at the metadata of picture files, so if you don't remember why you took that picture of a pine tree, the date and time might remind you.)
Once you have them all (and you'll have files you don't recognize, files you don't want - it's all or nothing, it recovers anything that looks like a file), format the SD card, then you can copy whatever you want to the card. Then just put the card back in the phone and turn the phone on.
In the future, keep all important files backed up to at least your PC (and to a cloud account in addition isn't a bad idea)..