title: Android Studio loses files after git branch change
body: <p>As the title says, Android studio loses/removes project directories on branch change. This happens for the same branch every time. It's a flutter project, repository is hosted on github. I tried creating a new branch from this one and the same thing happens. When checking out other branches, the project directories are all there. <a href="https://i.stack.imgur.com/DrwWz.png" rel="nofollow noreferrer">Android studio</a></p>
  <h1>Update:</h1>
  <p>flutter doctor:</p>
  <pre><code>[✓] Flutter (Channel stable, 2.5.1, on macOS 11.6 20G165 darwin-x64, locale en-HR)
  [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
  [✓] Xcode - develop for iOS and macOS
  [✓] Chrome - develop for the web
  [✓] Android Studio (version 4.1)
  [✓] VS Code (version 1.56.2)
  [✓] VS Code (version 1.55.2)
  [✓] Connected device (1 available)
  </code></pre>
  <p>.gitignore:</p>
  <pre><code># Created by https://www.gitignore.io/api/dart,flutter,visualstudiocode
  # Edit at https://www.gitignore.io/?templates=dart,flutter,visualstudiocode
  
  ### Dart ###
  # See https://www.dartlang.org/guides/libraries/private-files
  
  # Files and directories created by pub
  .dart_tool/
  .packages
  build/
  # If you're building an application, you may want to check-in your pubspec.lock
  pubspec.lock
  
  # Directory created by dartdoc
  # If you don't generate documentation locally you can remove this line.
  doc/api/
  
  # Avoid committing generated Javascript files:
  *.dart.js
  *.info.json      # Produced by the --dump-info flag.
  *.js             # When generated by dart2js. Don't specify *.js if your
                   # project includes source files written in JavaScript.
  *.js_
  *.js.deps
  *.js.map
  
  ### Flutter ###
  # Flutter/Dart/Pub related
  **/doc/api/
  .flutter-plugins
  .flutter-plugins-dependencies
  .pub-cache/
  .pub/
  
  # IntelliJ related
  *.iml
  *.ipr
  *.iws
  .idea/
  
  # Android related
  **/android/**/gradle-wrapper.jar
  **/android/.gradle
  **/android/captures/
  **/android/gradlew
  **/android/gradlew.bat
  **/android/local.properties
  **/android/**/GeneratedPluginRegistrant.java
  **/android/key.properties
  
  # iOS/XCode related
  **/ios/**/*.mode1v3
  **/ios/**/*.mode2v3
  **/ios/**/*.moved-aside
  **/ios/**/*.pbxuser
  **/ios/**/*.perspectivev3
  **/ios/**/*sync/
  **/ios/**/.sconsign.dblite
  **/ios/**/.tags*
  **/ios/**/.vagrant/
  **/ios/**/DerivedData/
  **/ios/**/Icon?
  **/ios/**/Pods/
  **/ios/**/.symlinks/
  **/ios/**/profile
  **/ios/**/xcuserdata
  **/ios/.generated/
  **/ios/Flutter/App.framework
  **/ios/Flutter/Flutter.framework
  **/ios/Flutter/Generated.xcconfig
  **/ios/Flutter/app.flx
  **/ios/Flutter/app.zip
  **/ios/Flutter/flutter_assets/
  **/ios/ServiceDefinitions.json
  **/ios/Runner/GeneratedPluginRegistrant.*
  **ios/Flutter/flutter_export_environment.sh
  **ios/Flutter/.last_build_id
  **ios/Flutter/Flutter.podspec
  
  # Exceptions to above rules.
  !**/ios/**/default.mode1v3
  !**/ios/**/default.mode2v3
  !**/ios/**/default.pbxuser
  !**/ios/**/default.perspectivev3
  !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
  
  ### VisualStudioCode ###
  .vscode/*
  !.vscode/tasks.json
  !.vscode/extensions.json
  
  # Miscellaneous
  *.class
  *.log
  *.pyc
  *.swp
  .DS_Store
  .atom/
  .buildlog/
  .svn/
  
  ### VisualStudioCode Patch ###
  # Ignore all local history of files
  .history
  
  # End of https://www.gitignore.io/api/dart,flutter,visualstudiocode
  *.env
  </code></pre>