git checkout yourBranch git reset --soft HEAD~$(git rev-list --count HEAD ^master) git add -A git commit -m "one commit on yourBranch"