When you delete the last file in a directory from Git on the command line ( git rm dir/file.txt), Git itself automatically deletes the entire directory.
In other words: the IDE behaves the same as Git.
Can I prevent this?
Nope. At least for now.
http://youtrack.jetbrains.com/issue/IDEA-75590 - (//), .