Must a bending of the cylinder leave the bases planar?
There's a nice paper by Halpern and Weaver: Inverting a cylinder through isometric immersions and isometric embeddings which shows (among other things) that:
[a right circular cylinder] can be turned inside out through embeddings which preserve its flat Riemannian metric provided its diameter is greater than $(\pi+2)/\pi$ times its height.
(from the abstract)
So in fact, your cylinder can be fully inverted by a bending (since the ratio of diameter to height is $2>(\pi+2)/\pi\approx 1.637$).
Halpern and Weaver's inversion is described in Section 10 of their paper and involves folding portions of the cylinder like an "accordion" and then twisting those portions around axes in the $xy$-plane.
These figures from the paper show a top view of the cylinder and the initial accordion folding.
This figure represents the folded cylinder after twisting the accordion around the axes.
Here's another construction they offer, along the lines of Alexandre Eremenko's answer. Note that their cylinder is the product of the unit circle $S^1\subset\mathbb{R}^2$ with the interval $[-h,h]$:
Here is a general way to construct a large family of bendings of the cylinder $M$, with nonplanar boundaries, via Alexandrov's isometric embedding theorem. All these examples will be convex.
First note that the geodesic curvature of the boundary components of $M$ is zero. Let $D_1$ and $D_2$ be any pairs of convex planar disks with smooth positively curved boundaries $\partial D_1$, $\partial D_2$ which have the same length as the boundary components of $M$. Gluing $D_i$ along the boundaries of $M$ yields a a closed surface $\overline M$ with a metric that has everywhere nonnegative curvature, because geodesic curvatures of $\partial D_i$ are nonnegative. Thus, by Alexandrov's isometric embedding theorem, $\overline M$ admits an isometric embedding into $R^3$ as a convex surface $\overline M'$. Let $M'$ and $D_i'$ be the images of $M$ and $D_i$ in $\overline M'$.
I claim that $M'$ cannot have planar boundary components when $D_1$ and $D_2$ are non-congruent. Indeed, the only time when $M'$ has planar boundaries is when $D_1$ and $D_2$ are congruent, and the corresponding points on their boundaries are glued to the end points of the same line of ruling of $M$. To see this note that if $D_1'$ is planar then the principal normals of $\partial D_1'$ (which are non-vanishing by the positive curvature assumption on $\partial D_i$) must lie in the plane of $D_1'$. But the principal normals of $\partial D_1'$ must be orthogonal to $M'$ since boundary components of $M'$ are geodesics (being a geodesic is an isometric invariant). So $M'$ has to be orthogonal to the plane of $D_1'$.
Thus, if $D_1'$ is planar, then all tangent planes of $M'$ along $\partial D_1'$ are orthogonal to the plane of $D_1'$. But since $M'$ is convex, its tangent planes are support planes. So $M'$ has to lie inside a right cylinder, say $S_1$ generated by $D_1'$. Similarly, if $D_2'$ is planar, then $M'$ has to lie inside a right cylinder $S_2$ generated by $D_2'$. It follows then that, if $D_1'$ and $D_2'$ are both planar, then $S_1=S_2\supset M'$. In particular $D_1'$ and $D_2'$ are congruent, lie in parallel planes, and are directly "above" each other (i.e., the orthogonal projection of $D_1'$ into the plane of $D_2'$ coincides with $D_2'$).
Note: It is important in the above construction that $\partial D_i$ be smooth. Indeed when $D_i$ are triangles, then $M'$ will form the sides of an antiprism, with bases $D_i'$.
It seems easy to obtain a negative answer by simple experiment. Make the lateral surface of this cylinder of paper. Then squeeze one base with your fingers (leaving another base free). Both bases cannot remain planar: indeed the lines $\theta=\mathrm{const}, z\in[0,1]$ in the original non-squeezed position were all of the same length $1$. And they were perpendicular to both base planes. In the squeezed position, their lengths must be still $1$ but they are not all perpendicular to any plane anymore, so both bases cannot remain planar.