code: func (d *deployerImpl) removeFromSiteRoot(ctx context.Context, subdir string, files []pkg.FileInfo, keep *pathTree) {
  	dirsToCleanup := stringset.New(0)
  
  	for _, f := range files {
  		rootRel := filepath.Join(subdir, filepath.FromSlash(f.Name))
  		if keep.has(rootRel) {
  			continue
  		}
  		absPath, err := d.fs.RootRelToAbs(rootRel)
  		if err != nil {
  			logging.Warningf(ctx, "Refusing to remove %q: %s", f.Name, err)
  			continue
  		}
  		if err := d.fs.EnsureFileGone(ctx, absPath); err != nil {
  			logging.Warningf(ctx, "Failed to remove a file from the site root: %s", err)
  		} else {
  			dirsToCleanup.Add(filepath.Dir(absPath))
  		}
  	}
  
  	if dirsToCleanup.Len() != 0 {
  		subdirAbs, err := d.fs.RootRelToAbs(subdir)
  		if err != nil {
  			logging.Warningf(ctx, "Can't resolve relative %q to absolute path: %s", subdir, err)
  		} else {
  			removeEmptyTrees(ctx, subdirAbs, dirsToCleanup)
  		}
  	}
  }
docs: // removeFromSiteRoot deletes files from the site root directory unless they
  // are present in the 'keep' set.
  //
  // Best effort. Logs errors and carries on.