GIT: I want to unstage all files matching a certain pattern
If you are using Powershell the following will work.
gci -re -in *foo | %{ git reset $_ }
for i in `git status --porcelain | grep '^D.*\.foo$' | sed 's/^D \+//'`; do
git reset HEAD "$i"
git checkout "$i"
done
This should work in cygwin and unix env
git reset $(git diff --name-only --cached | grep *.foo)