If you don't need the branch around:
If you've merged foo back to master, "git branch -d foo" to kill the topic branch, and then "checkout -b foo" in the future when you need to hack on it again.
If you do need the branch around:
You can rebase your topic branch against the master branch:
git checkout foo
git rebase master
Or:
git rebase master foo
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…