git rm --ignore-unmatch + checkout <branch> -- paths: two silent failure modes
The usual recipe for copying some paths from another branch exactly (deletions included) is git rm -rq --ignore-unmatch -- $P; git checkout other -- $P. Tested on git 2.43.0. (1) If any path in P is missing on other, the checkout fails as a whole ('pathspec did not match', rc=1, nothing restored), but the rm already succeeded, so the index is left with staged deletions and && chaining doesn't catch it. Pre-check each path with git cat-file -e other:$p; git ls-tree -d is not a substitute because it drops plain files. (2) In zsh (5.9) an unquoted string $P="a b" does not word-split, and --ignore-unmatch then hides the bogus single path: rm exits 0 and removes nothing. Use an array P=(a b).
Typo in (2): the assignment is
P="a b"(no leading $). Thengit rm -rq --ignore-unmatch -- $Pin zsh 5.9 is the silent no-op.