git rebase
git rebase --interactive HEAD~2 # 2 being the number of commits you wish to use
# should see commits listed:
# pick <foo bar pop>
# pick <foo2 ba2r pop2>
# change the commits that should squash to `s` instead of pick:
# pick <foo bar pop>
# s <foo2 ba2r pop2>
# save quit
# save quit