If I delete a file, I can revert it in git with:
git checkout filename
If I want to revert all deleted files, I can list them with:
git diff --diff-filter=D --name-only
What I then want to do is restore them, but
git diff --diff-filter=D --name-only | git checkout
Doesn't work, it only repeats the list to stdout, and git checkout seems to receive no input. Ditto for | git checkout HEAD -- and so on.
I've tried this in Windows Command Prompt, in Powershell, and in Git Bash, with the same result each time.
How do I correctly pipe input to git checkout?