One approach would be to rename the current master branch to wip, then create a new empty master branch.  Groups of commits could then be copied over to the new master branch from wip, combined into single commits in the new master.
# Rename the master branch to "wip" locally
git branch -m master wip
# Rename the remote master branch to "wip"
git push origin -d master
git push origin -u wip
# Check out a new, empty branch as master
git checkout --orphan master
git reset --hard
# Create a squashed commit matching the current state of wip
git checkout wip -- .
git add .
git commit
# Push the new master
git push origin -u master
Detailed explanation
Use the branch move option to rename the branch locally:
git branch -m master wip
Delete the remote branch using the push delete option, then add a new remote branch matching the local wip branch using the push upstream option:
git push origin -d master
git push origin -u wip
Create a new empty branch with no commit history.  This is done by creating an orphan branch (one without any commits) using the
checkout orphan option.  The existing files will remain (uncommitted), so delete them using the reset hard option:
git checkout --orphan master
git reset --hard
Copy the current state of the wip branch to the master branch.  First, copy all files from the wip branch by using the checkout with pathspec option with the current working directory pathspec (.) to recursively include all files in the current working directory.  These files are all added to the index using the add with pathspec option with the current working directory pathspec.  Finally, a single commit with all these files is created using the commit option:
git checkout wip -- .
git add .
git commit
Finally, the new master branch is pushed to the origin using the push upstream option:
git push origin -u master