$ hg update BASE_COMMIT $ hg revert -a -r { HEAD_COMMIT | BRANCH_NAME } $ hg commit -m "squashed commits"