You should also check with an explorer if you have backup files. C::B first saves the new file to a temporary, then renames the old one, renames the temporary an finally removed the old one. So chances are that you've the old content in a back file.
This.
Code::Blocks is extremely careful never to overwrite a file and to always make sure that data cannot be lost. Unless someone played with the save function and broke something (very unlikely!), you can only lose data if you save your files in a "special" location such as
Program Files . Note that Windows (starting with Vista, but getting worse with every release thereafter) is outright lying to you sometimes.
Sadly, there is nothing from a program's point of view that can be done if the operating system tells you "Alright, everything is OK" and you later find out that you have been lied to and the operating system silently deleted the file after you closed the handle. The only thing you can do
as a user is to avoid locations where Windows will apply its super smart behavior.