You camera (all digital cameras, not just Nikon) can only read files that it writes to the card. In addition, should always format the card in the camera you are going to use it in. Now, back to your problem.
It sound like you just stuck your card into your computer and edited the images in the card and after editing, saved the file in the card. That's a NO NO because your computer is writing the files into the card. Your computer can read them but your camera cannot - when you hit "save", you over-wrote the original files and because it's a file written by the computer, your camera cannot read it. Then you formatted your SD card, you have basically wiped out ALL your images in the SD card - it's now a blank card like new. Sorry to say that but if you formatted your card, you have executed an "Erase ALL." (Now if those images are from a once in a life-time vacation trip, there are data recovery places that can help retrieve them for you but that will cost you an arm and a leg (people who use those services are law enforcement, courts forensics and insurance people who can afford to pay!)
So, keep in mind this simple rule - your computer (any computer) can read files written on SD cards by any camera - but not the other way around. Your camera (no cameras) can read files written on SD card by any computer!
With that clear in mind, this is what you should do after you have taken pictures. Insert your SD card in your computer and DOWLOAD the images into a folder in your computer. This process just make copies of all the images files from the SD card to your computer (how you organize it is up to you.) They are copies and you can edit them to your hearts content and save them etc. The images in the SD cards will remain intact and unmolested unless and until you delete them or reformat the card.
If you are not infinitely rich and can afford to keep buying SD cards and never reformat them for reuse, here is the normal workflow:
1. Make a folder in your computer for your pictures (Name it "My Photos?") Inside that folder you can have sub folders to organize your picture - by events ("Baby's Birthday 2014", "Trip to Italy 2013" etc)
2. When you are done with your photographing and is ready to do some editing (aka "Post-Processing") insert the SD card into the computer and download all the photos to the appropriate folder. Then download another copy into your backup drive or "Time Machine" so you have two copies. Verify that you have all the images in your computer in two places.
3 Insert your SD card in your camera and format it - now you are ready for you next photo event/expedition.
Hope this helps.