[versioning] make sure that getVersions() return the correct path

otherwise versions can be lost while moving a file to the trash bin