fix a problem during git checkout a different version, where updated directories are deleted even though the directory is not empty.