Working sketch disappeared

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:

C:\Users\<user name>\AppData\Local\Temp\arduino_build_<build folder number>

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.