def METHOD_NAME(self):
    apply_head = self.scm.get_ref(self.ref)
    head = self.scm.get_rev()
    if apply_head != head:
        raise DvcException(
            f"Cannot revert workspace, current HEAD '{head[:7]}' does not match the"
            f" pre-apply HEAD '{apply_head[:7]}'"
        )
    self.scm.reset(hard=True)
    if len(self):
        # In the event that the apply-stash and current workspace contain
        # conflicting untracked files, we do:
        #   1. stash the current untracked files
        #   2. restore/pop the apply-stash (with untracked files)
        #   3. restore/pop the untracked files from (1) and ignore any conflicts
        #      (forcefully reverting to the apply-stash version)
        workspace_rev = self.scm.stash.push(include_untracked=True)
        try:
            self.pop()
        finally:
            if workspace_rev:
                self.scm.stash.pop(skip_conflicts=True)
    self.scm.remove_ref(self.ref)