@log_calls
  def revert(self, scope, path_list=None, backup_suffix=BACKUP_SUFFIX):
    '''Revert specified files in working directory to original state. If path_list is empty or None, revert all files.'''
    full_revert = not path_list
    rev = self.get_checkout_rev(scope)
    mf = self.repo.get_manifest(scope, rev)
    local_scope_dir = join_path(self.work_dir, scope)

    # Pick all items unless we have a list
    items = mf.get_items(path_list) if path_list else mf.items
    if None in items:
      raise InvalidArgument("item not found in rev %s of scope '%s': %s" % (rev, scope, path_list[items.index(None)]))

    # Get changelist needed to revert, and update files
    (old_fingerprints, new_fingerprints) = self._fingerprint_status(scope, compute_md5=False)
    changelist = changelist_for_fingerprints(new_fingerprints, old_fingerprints, lazy_md5s=True, root_path=local_scope_dir)

    # TODO support reverting to a differetn revision: compute changelist for update,
    # and compose with changelist for working dir revert

    # Revert command will only delete explicitly listed items, unless we are doing a full revert.
    new_fingerprints = self._update_local_files(scope, items, changelist, delete_items=True, delete_all=full_revert, backup_suffix=BACKUP_SUFFIX)

    # Update checkout states to reflect new mtimes, so hashes aren't recomputed later
    self.checkout_state.update_fingerprints(scope, new_fingerprints)
    self._write_checkout_state()
dataset/ETHPy150Open bloomreach/zinc/zinc.py/WorkingDir.revert/original