You can use an interactive rebase to remove the directory from your past commits:
# Go back 3 commits
git rebase -i HEAD~3
You'll see your editor open with with list of commits:
pick <HEAD~2> Commit /vendor/bundle/*
pick <HEAD~1> OMG ignore /vendor/bundle/*!
pick <HEAD> OMG ignore /vendor/bundle/* again!
Select the commit where you committed the directory and replace pick
with edit
:
edit <HEAD~2> Commit /vendor/bundle/*
pick <HEAD~1> OMG ignore /vendor/bundle/*!
pick <HEAD> OMG ignore /vendor/bundle/* again!
The rebase will rewind to that commit and stop. Then do the following:
git rm -r -- /vendor/bundle
git commit --amend --no-edit
git rebase --continue
You can read more about rewriting git history from the FREE online Pro Git book.