I have a perfectly working sketch. I successfully compiled and saved it. I had a bad laptop battery and lost all power while the sketch was open. When I reopened the IDE on my laptop and opened the sketch, it appears blank with no lines of code. Using file manager, it shows the sketch to be 10K in size.
I then tried to open the file with the online Arduino editor. When I did, the sketch appeared as all periods (............).
Yes I opened the .ino file in Notepad. Although the file appeared to be empty, when I select the space by left click and dragging the mouse to select the text, it actually selects something. Its almost like the font is invisible or something. For fun, I opened the file in MS Word and it had several pages of symbols (actually all square boxes) so it appears the file is not empty.
That's unfortunate. If you had come here first you would have found out that the IDE places the modified sketch in the TEMP directory. Copying that file followed by some fairly minor edits would have you back in business.
There is a slight chance the modified sketch is still in the TEMP directory.
As mentioned above, every time you compile your sketch, a copy is saved to a temporary build folder on your computer. This folder is removed when you close the Arduino IDE, but since the computer shut off it's likely the build folder was never removed. The folder will be something like this:
Where <user name> is your Windows user name, and <build folder number> will be some random number.
Note that the C:\Users\<user name>\AppData folder is hidden by default. You will need to configure Windows File Explorer to show hidden files before it will be shown.
If there are multiple folders matching the temporary build folder format, you can sort them by "Date Modified" to narrow down the possibilities to the ones that were modified during the relevant time frame.
The sketch code will be in the sketch subfolder, in a file with the .ino.cpp file extension. You can open it up in a text editor. It will have a little bit of extra code added to it, but the sketch code will be easy enough to separate from it. We can help you out with that if needed.