Note : this does not deal with history for sensitive information.
This process definitely takes some undertanding of what is going on with git. Over time, having gained that, I've learned to do processes such as:
.gitignore
to ignore them - in many cases such as yours, the parent directory, e.g. log/
will be the regex to use..gitignore
file change (not sure if push needed mind you, no harm if done).git remove --cached some_dir/
git add .
git commit -m"removal"