Here's the answer:
“ich wollte nicht mitgehen, aber ich musste”
Watch a real native speaker say it:
Here's how it sounds in a textbook:
You could also say:
- ich wollte nicht mitgehen, ich musste aber
Fun fact: the hundreds of thousands of people learning German with Memrise get this phrase correct 94.49% of the time!