I hibernated my laptop when Android Studio was running and found later that the laptop had been shut down. Now one of my source files is appearing empty in Android Studio an
See if Android Studio kept a version in local history.
Go to your java file in Android Studio, and navigate to
VCS -> Local History -> See History
Also, start using version control, like git.