Needing last week’s version of a single file, without moving the whole branch back, is a common situation. Older advice reaches for git checkout, which does too many things. git restore only does this one.
git restore --source=HEAD~3 -- src/settings.php
--source takes a commit, branch or tag. The file in your working tree is replaced by that version and the rest of the repository stays as it is. The manual’s own example is git restore --source master~2 Makefile.
By default only the working tree changes, so you can look at the result, run your tests and commit it, or throw it away with a plain git restore src/settings.php. To put the old version in the index as well, add --staged, or use --staged --worktree for both.
Caveat: it overwrites the file in your working tree without asking. If you have uncommitted edits in that file, they are gone. Run git diff src/settings.php first, or stash.
To see which version you want before you restore, git show HEAD~3:src/settings.php prints the old file without touching anything. The command needs git 2.23 or newer, which is where restore came in.
Further reading: git restore (Git documentation)