Prevent git restore -- pathspec from checking out submodules

I am working on a project that uses submodules. I have checked out branches in the submodules and a changed file in the superproject. git status looks like this

On branch branch1
Changes not staged for commit:
    modified:   somefile.txt
    modified:   dir-a/submodule1 (new commits)
    modified:   dir-b/submodule2 (new commits)

Submodules changed but not updated:

* dir-a/submodule1 9726e06...0bd1d55 (1):
  > A commit message

* dir-b/submodule2 53b9bf0...ae1b023 (1):
  > Another commit message

no changes added to commit

I want to remove the changes from somefile.txt so I do

$ git restore -- somefile.txt

However not only does it restore somefile.txt, it also checks out the submodules:

Submodule path 'dir-a/submodule1': checked out '9726e06'
Submodule path 'dir-b/submodule2': checked out '53b9bf0'

Passing --(no-)recurse-submodules does not make a difference, and neither does using git checkout instead of git restore.

Is there a way to restore somefile.txt without checking out the submodules? Git version is 2.30.2.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum