I had my android studio projects in the same folder as android studio. Today when I updated Android studio, it prompted me that some files need to be deleted to continue the installation. I didn't pay too much attention think it's some small files in the projects folders but then the whole folder was gone. I restored the project folder back using Disk drill. But some of the files in some of those projects have become like this. Most of the corrupted files seem to be the main activity, unit and instrumented test kotlin files.
main activity file some files in res/drawable folder
I tried deleting the caches, recover the specific files separately. But nothing has worked. I even downloaded Android studio again(in the same drive it was in) after having recovered the project files in a separated drive. I asked chatgpt about this and tried the solutions and nothing worked. Solutions from some other posts on Stack Overflow regarding similar but not the exact problem, also didn't work.