git search history for file

C++
$ git log --grep=word
git log --all --full-history -- "**/thefile.*"

Source

Also in C++: