code: def test_apply_unchanged_head(tmp_dir, scm, dvc, exp_stage):
      # see https://github.com/iterative/dvc/issues/8764
      tmp_dir.gen("params.yaml", "foo: 2")
      scm.add(["dvc.yaml", "dvc.lock", "params.yaml", "metrics.yaml"])
      scm.commit("commit foo=2")
      results = dvc.experiments.run(exp_stage.addressing)
      # workspace now contains unchanged (git-committed) params.yaml w/foo: 2
      exp = first(results)
      dvc.experiments.run(exp_stage.addressing, params=["foo=3"])
      # workspace now contains changed params.yaml w/foo: 3
  
      dvc.experiments.apply(exp)
      assert (tmp_dir / "params.yaml").read_text().strip() == "foo: 2"
  
file_path: dvc/tests/func/experiments/test_apply.py
imports: import pytest
  from funcy import first
  from dvc.repo.experiments.refs import CELERY_STASH
label_desc: Use image node_id 5 for calling a global function with example usage: test_apply_unchanged_head(tmp_dir, scm, dvc, exp_stage) without return types