The basic physics in laymen's terms
Why that leads to twisting
If you rotate with the somersault, the twist always looks the same
However, maybe you are judging twists from the ground, particularly from a frame that is looking at the jump "in the path" that the jump is happening. Then, when you see someone who is face-up vs. face-down executing what they thing is a counterclockwise rotation, it will look counterclockwise when we see them head-on (we look down at the ground when we label our rotations as counterclockwise or clockwise, rather than looking at the sky, so it's a bird's eye view) or clockwise when we see them foot-on. So if this gymnast is coming toward you, a left-arm lowering on the first half of their jump, when their head is facing you, looks counterclockwise while on the second half of their jump it looks clockwise, and vice versa.
Fictitious forces, angular velocities
The mathematics which applies here, allowing us to describe the world from the perspective of the person who is somersaulting, is the mathematics of rotating reference frames. When you make your coordinates rotate in some way, like with the initial "backflip" of the gymnast, then you have to add two "fictitious forces". We'll say that the gymnast's center-of-mass is moving horizontally in the $\hat x$ direction, and vertically in the $\hat y$ direction. We'll also describe the direction to the gymnast's left, which as they start out is $\hat x \times \hat y$ in terms of the cross product, as the $\hat z$ direction: in this direction sits some audience watching the gymnast move from their left to right.
They start off rotating head-over-heels with some angular frequency $\omega$; in physics we treat this as a vector whose magnitude is $\omega$ but whose direction is in the axis of rotation. That specifies only two opposite directions, so the usual convention is the "right hand rule", you curl your right hand in the direction that they're going and your thumb points in the "correct" direction; if you are looking at the rotation vector $\vec \omega$ "tip-on" then the rotation looks counter-clockwise. So that means that our rotation vector for a backflip in our rotating reference frame, in terms of the ground-coordinates, is:$$\vec \omega = - \omega \hat z$$.
With the two fictitious forces, we can just do physics in the co-rotating frame. Suppose we have a rigid 3-body system with a mass M at position $(x, y, z) = (0, -d, 0)$ with two massless "shoulders" at $(x, y, z) = (0, 0, \pm s)$ supporting two "arms" of mass m at height h: $(0, h, \pm s)$. We choose $d$ so that the center of mass is at 0; this means $d = 2 m h / M$. This means that there's a force-balance of centrifugal forces $-m \vec \omega \times (\vec \omega \times \vec r)$, as well as a torque-balance: in our co-rotating reference frame, nothing is yet changing.
Two delta-function forces, some irrelevant centrifugal/center-of-mass cartwheeling.
In a short time $t$ we pull $h$ entirely into its shoulder at a constant speed $h/t$. This requires two short intense forces directed from the left arm to the shoulder, which undo each other eventually but will pull the system up by a distance $d/2$ and rotate the system a little about its center-of-mass in the "cartwheel-right" ($\hat x$) direction. We'll ignore this because $M$ is large compared to $m$.
There is now a centrifugal torque: we used to have a centrifugal torque balance and we still almost (for small $d$) have a centrifugal force balance which becomes exact when we accept the slight rotation above: but now the torque due to the centrifugal force on the right $m$ is unbalanced. This leads to a more persistent "cartwheel-left" (-\hat x) rotation, at least at first: at it goes more in this direction it decreases its own effort arm and increases the effort arm of $M$ and moves the left $m$ to counterbalance. We can imagine that it basically oscillates about an equilibrium, which we'd call precession about an axis. This is also not really the twisting.
These "cartwheel" effects are definitely somewhat noticeable; see e.g. this instructional video where you can see that, while the young man is in midair and upside-down, he is not pointed straight along the $\hat y$ axis but along some combination of $\hat y$ and $\hat z$.
Twist comes from the Coriolis force.
The remaining effect is the Coriolis force, $-2m \vec \omega \times {d\vec r \over dt}.$ This does not have a long-lasting torque because after a short time $t$ we know that $\frac{d\vec r}{dt} = 0$ for the left-mass. But while it is moving, the Coriolis force provides a constant force$$-2 m (-\omega \hat z)\times(-\frac{h}{t}~\hat y) = +2m \omega ~\frac{h}{t}~\hat x$$ to either shoulder if its arm drops/adducts: a "forward" motion stemming from both the sign of $h$ as positive and the choice of direction for $\vec\omega$ along the $-\hat z$ axis.
If you start off facing $-\hat x$ then the $-\hat z$ rotation is a "backwards somersault" and "your left" shoulder is at $s \hat z$. This motion of your left shoulder appears to be "towards your back", as I mentioned above. Let's do this explicitly.
The torque of the force is $$\vec \tau = \vec r \times \vec F = \int_0^1d\alpha~\left[\begin{array}{c}0\\ \alpha h \\ s\end{array}\right] \times \left[\begin{array}{c}2m \omega h/t\\ 0\\ 0\end{array}\right] = \left[\begin{array}{c}0\\ 2 ~m~ \omega~ h ~s / t\\-m ~\omega ~h^2/t\end{array}\right]$$which acting over a time $t$ produces a net angular momentum in the co-rotating frame of:$$\vec L = t~\vec \tau = \left[\begin{array}{c}0\\ 2 ~m~ \omega~ h ~s \\-m ~\omega ~h^2\end{array}\right]$$The z-component of this expression suggests indeed that you start rotating forward faster (because you pulled in a limb making yourself spin a little faster!) and also that you start "twisting" about the $\hat y$ axis. Your moment of inertia about this axis is just $2 m s^2$ so you should describe a rotation rate $+~\hat y~\omega~h/s$, which is counterclockwise when seen from the top down, the way that you would describe your rotation.
Again, from the ground, the issue is basically just that if you set a top on a glass spinning counterclockwise when viewed "normally" from the top down, then if you look at it from under the glass table you'll see it move clockwise. Similarly, whether you see the gymnast's rotation as clockwise or counterclockwise from the ground depends on whether their head is pointed at you (counterclockwise) or their feet are pointed at you (clockwise).