docstr: Selectively apply changes from stash_rev.
  
  Only changes to files from left which do not exist in right will be applied.
docstr_tok: ["Selectively","apply","changes","from","stash_rev",".","Only","changes","to","files","from","left","which","do","not","exist","in","right","will","be","applied","."]
code: def _apply_difference(self, stash_rev: str, rev: str):
      """Selectively apply changes from stash_rev.
  
      Only changes to files from left which do not exist in right will be applied.
      """
      self._copy_difference(stash_rev, rev)
      commit = self.scm.resolve_commit(stash_rev)
      for parent_rev in commit.parents:
          parent_commit = self.scm.resolve_commit(parent_rev)
          if parent_commit.message.startswith("untracked files on "):
              self._copy_difference(parent_rev, rev)
  
imports: import re
  from contextlib import contextmanager
  from typing import Dict, Iterable, Iterator, NamedTuple, Optional
  from scmrepo.git import Stash
  from dvc.exceptions import DvcException
  from dvc.log import logger
  from dvc_objects.fs.local import localfs
  from dvc_objects.fs.utils import as_atomic
  from .refs import APPLY_HEAD, APPLY_STASH
label_desc: Use image node_id 4 for calling the ApplyStash obj's underlying member method code with example usage: obj._apply_difference(stash_rev, rev) without return types