How to fix error: Untracked Files Prevent Checkout in Android Studio/IntelliJ IDEA

Опубликовано: 25 Февраль 2026
на канале: Awesome Dev Notes
7,582
19

When trying to checkout a git commit or a branch while a file which was previously tracked is changed and not tracked in the VCS anymore. This untracked files prevent commit error could occur.

Solution:

stash/shelve it if the change was unintentional and you don't want/care if the change makes it production code/remote code.

commit it if you want to have the changed content make it to production code/remote code.

In both cases, file will not be deleted but only the changes will be affected.

📚 Learn Android from Experts at:
https://github.com/androiddevnotes/aw...

😎 Find more Awesome Android Apps in Kotlin, MVVM, Jetpack:
https://github.com/androiddevnotes/aw...

📱 Follow us on:

⭐ Discord:
  / discord  

⭐ GitHub:
https://github.com/androiddevnotes

⭐ Twitter:
  / androiddevnotes  

⭐ Instagram:
  / androiddevnotes  

⭐ Medium:
  / androiddevnotes