1. git checkout modified-branch
2. git rebase master
3. checkout master
4. git merge modified-branch
5. git rebase -i origin/master

at this point, “squash” (or “s”) all commits but the first (leave that as “pick” or “p”)