I'm not sure what you're showing the screenshots, but it is important to understand how Git works because it is very different than other version control systems.
When adding files to a project, until you've committed the files, they are not in any branch - they are "unstaged" or possibly "staged" and not committed. If you then switch to another branch, Git won't remove this file because there is no version of it committed, so removing it will just delete data that cannot be restored.
So Git will not hide/delete/remove uncommitted files (and even line changes) and instead will keep them in the working copy even if you switch branches.
You can see the file is uncommitted in the file tree because it is colored green. See the InteliJ IDEA color coding for version control here: https://www.jetbrains.com/help/idea/file-status-highlights.html