code: def test_stats_on_updated_file_from_tracked_dir(tmp_dir, dvc, scm):
      tmp_dir.dvc_gen(
          {"dir": {"subdir": {"file": "file"}, "other": "other"}},
          commit="initial",
      )
  
      tmp_dir.gen("dir/subdir/file", "what file?")
      tmp_dir.dvc_add("dir", commit="update file")
      scm.checkout("HEAD~")
      assert dvc.checkout() == {
          **empty_checkout,
          "modified": ["dir" + os.sep],
      }
      assert dvc.checkout() == empty_checkout
  
      scm.checkout("-")
      assert dvc.checkout() == {
          **empty_checkout,
          "modified": ["dir" + os.sep],
      }
      assert dvc.checkout() == empty_checkout
  
imports: import logging
  import os
  import shutil
  import stat
  import textwrap
  import pytest
  from dvc.cli import main
  from dvc.dvcfile import PROJECT_FILE, load_file
  from dvc.exceptions import CheckoutError, CheckoutErrorSuggestGit, NoOutputOrStageError
  from dvc.fs import system
  from dvc.stage.exceptions import StageFileDoesNotExistError
  from dvc.utils import relpath
  from dvc.utils.fs import remove
  from tests.utils import get_gitignore_content
label_desc: Use image node_id 24 for calling a global function with example usage: test_stats_on_updated_file_from_tracked_dir(tmp_dir, dvc, scm) without return types