The act of formatting usually destroys any data on the storage device, in this case your card. So it's neither before nor after, but during.
If you haven't already backed up your photos (and I assume not given that you were copying them to your PC) then you are in for a stressful time. From your description it seems like the camera is saying it can not read your memory card and so wants to start again from scratch.
First refuse to format. Then check to see if all the photos have already downloaded to the PC. If they have you can breath a sigh of relief. If not then you need to find something else that may be able to read the card. Perhaps another camera, perhaps a card reader connected to your PC.
If you can find something that can read the card use it to download the photo files to, say your PC, as a matter of priority. If you have tried everything and nothing reads your card, then you may have to accept the photos have gone. But try friend's cameras or even shops which claim to print your digital photos first. Anything that works.