How to switch back to 'master' with git?
According to the Git Cheatsheet you have to create the branch first
git branch [branchName]
and then
git checkout [branchName]
You need to checkout the branch:
git checkout master
or
git checkout main
See the Git cheat sheets for more information.
Edit: Please note that git does not manage empty directories, so you'll have to manage them yourself. If your directory is empty, just remove it directly.