My repository has only two branches: default and stable. I made a mess in the stable branch but I have no clue on how to fix it.

The default branch is for new feature
92 is the revision created by the maven-release-plugin.
93 commit on stable
94 merge stable into default
95 to 98 commit on default
99 merge default into stable
100 to 103 commit on stable
104 try to fix the mess with a hg merge -r 98
For default I want the head to be 98. For stable I want to go back to a single head including the commit 94 to 98.
Default‘s head should be 98; is it not? Runhg heads defaultto get the list of changesets that are heads on thedefaultbranch. From your graph, this is 98 and only 98.For stable, it sounds like you want to
hg mergecommits 103 and 104. To do that, update to one of them (hg update 103), then merge the other one in (hg merge 104).You’ll still have to take care of commit 93. Did you want to have it in
stablealso? Or do you want to not have its effects? If you want to have it instable, just merge it in also.If you don’t want its effects in
stableat all, what you need to do will differ depending that’s happened to it. Is it just on your local computer, or have you already pushed it upstream? If it’s just on your local computer, runninghg strip 93will remove it from your repository, and it won’t get pushed remotely. To do this, you’ll have to enable the mq extension.If you have pushed 93 upstream, you can’t strip it. What you can do, however, is make a commit that undoes the effects of 93 by updating to changeset 93, then running
hg backout 93. Then, you can merge your new commit into thestablebranch, and it will be as though you never committed 93. 93 will be in your history, but its code changes are gone.