How can I recover missing Dart files from my old Flutter project after accidentally deleting a project folder?
I have an old Flutter project named kolam, which I originally developed using an older version of Android Studio (Panda).
The original project was located at:
C:\Users\velan\AndroidStudioProjects\kolam
Later, I uninstalled the old Android Studio and started using a newer version (Quail).
While working with the project, I accidentally used a terminal command that removed/deleted the kolam folder. I am not sure which command caused the problem.
After that, I found that the project contents appear to be split between two folders.
One folder is kolam copy. It contains pubspec.yaml and the package/dependency information.
The other folder is kolam. Its lib folder contains only:
lib/
└── main.dart
The following folders still exist, but their Dart source files are missing:
lib/
├── l10n/
├── models/
├── Providers/
├── screens/
└── theme/
These folders originally contained my Dart files.
The project was not connected to Git and I had not created a Git repository for this project, so Git cannot be used to restore the missing files.
I also used several commands while troubleshooting the project, including:
flutter clean
flutter create --platforms=android .
flutter pub get
flutter pub upgrade --major-versions
gradlew clean
gradlew assembleDebug
dart pub cache repair
I don't know whether any of these commands caused the Dart files to disappear.
I am now using Android Studio Quail, but I want to recover the original Dart files from the old kolam project.
I would like to know:
Can Android Studio Local History recover these missing Dart files?
Does Android Studio keep previous versions of files somewhere?
Could flutter create --platforms=android . remove existing Dart source files?
Is there another location where Flutter/Dart/Android Studio may have a copy of these files?
What is the safest way to recover the original lib files without overwriting the remaining project?
I still have the remaining kolam and kolam copy folders, so I want to recover the missing files safely.