.gitignore

Потребовалось исключить всю папку за исключением одного файла вглубине. В руководстве git про .gitignore написано, что

An optional prefix “!” which negates the pattern; any matching file excluded by a previous pattern will become included again. It is not possible to re-include a file if a parent directory of that file is excluded. Git doesn’t list excluded directories for performance reasons, so any patterns on contained files have no effect, no matter where they are defined.

Однако никакого примера не приведено.

В русскоязычном же руководстве вообще ничего не упомянуто про этот нюанс

В итоге, чтобы игнорировать всё содержимое папки кроме одного файла, можно справиться вот так

bower_components/react/* 
!/bower_components/react/react.js