It happened I would imagine because you tried to manipulate the images while they were still stored on your memory card.
What you need to do in future is transfer the images to your computer (either your Pictures folder or a folder of your choice) and edit them from there.
Also, when you need more space on your memory card, it's better to use your camera software to either delete the images after you've transferred them and/or format the card.
Just make sure the card is back in your camera when you delete the images, and that you've transferred them first.
When you transfer the images to your computer, you can either do it while your camera is switched on and connected to the computer or you can remove the memory card and use a card reader, which will save on camera battery power.