diff --git a/spyderlib/widgets/projectexplorer.py b/spyderlib/widgets/projectexplorer.py
index <HASH>..<HASH> 100644
--- a/spyderlib/widgets/projectexplorer.py
+++ b/spyderlib/widgets/projectexplorer.py
@@ -321,6 +321,8 @@ class Project(object):
                             item_preceding, tree, include, exclude, show_all)

                 parent_dirname = abspardir(dirname)

                 parent = dirs[parent_dirname]

+            if item_preceding is None:

+                item_preceding = parent

             item_preceding = self.create_dir_item(dirname, parent,

                                                   item_preceding, tree,

                                                   include, exclude, show_all)
Project explorer: when refreshing tree to show a new entry preceding the first item of a branch, this entry was added as the last item of the branch instead of the first one