system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How do they recover deleted data from a HDD?

Does it remain on the disk? If so, how does it free up space on the disk?
gpt
Usually when you delete a file on a HDD the data isn't actually deleted. Instead, the drive is just told that the area where the data is stored isn't important anymore and it can be written over. If you keep using the HDD, it will eventually overwrite the old data, but the data will remain on the drive until then. Your operating system tells you that the space on the disk is free because it's available to use for storage whenever you need it, but the computer isn't going to go changing the data until you have something else to store there. You can use a file shredder to clear the data out, but most people don't do that. 

Additionally, HDDs use a magnetic field to store information. A strong field indicates a 1 and a weak field indicates a 0. However, magnetic fields aren't binary and with a lot of work you can sometimes figure out what deleted data was based on the strength of the magnetic fields that remain. Edit: You can't actually recover any meaningful data this way. On older, less dense magnetic storage media it may have been a possibility, but that's not the case with any relatively modern HDD. The idea comes from a guy named Gutmann who wrote a paper on it in 1996. It would have been hard to do then and Gutmann himself has said it would be next to impossible these days.

It works differently with internal SSDs. Those usually clear the data out after it's deleted because and SSD can only store data in an empty spot. Consequently, your computer goes ahead and clears out the data after it's deleted to speed up the process of writing new data to that area in the future.