This thing recently happened with me, I also haven't any backup of my work and my laptop gone shut immediately after a lag. Then I restarted my Project Solution and it was same thing came to me, my CS file was opening again and again in Notepad. After some try i Got my data and file, let me Explain the Process, how i recovered my File :-
[Read Carefully]
Step 1 :- Right Click on your Root Folder into Solution Explorer.
Step 2 :- Click on -"Open Folder in file Explorer", Then your Solution will be open in the
file explorer.
Step 3 :- then Right Click on the File like "Default.aspx.cs" which is opening into
Notepad.
Step 4 :- Then Click on "Restore Previous Versions", and select the time you were Working
and click on "Ok" Button.
Step 5 :- Now Go and See the file into your Solution, Your Data will be there,
Note :- if, after this all, the data doesn't come into the file, then refresh the folder.