Let $\pi:P\to M$ be a principal $G$-bundle on a manifold $M$ endowed with a connexion $A$. Let $X$ be a tangent vector field on $M$ and let $Y$ be a (not-necessarily horizontal) lift of $X$ to $P$. In other words, for every $p\in P$ we have
$$\pi\_{\*,p}(Y\_p)=X\_{\pi(p)}\ .
$$
The vector field $X$ defines a one-parameter group $(\alpha\_t)$ of local diffeomorphisms of $M$ , and $Y$ defines a one-parameter group $(\beta\_t)$ of local diffeomorphisms of $P$.


Let $U$ be an open subset of $M$ such that $\alpha\_t$ is defined on $U$ and let


$$\alpha\_t :U\to V$$


the corresponding diffeomorphism. Then $\beta\_t$ will be defined over $\pi^{-1}(U)$ so we obtain a lift


$$\beta\_t:\pi^{-1}(U)\to \pi^{-1}(V)$$


of $\alpha\_t$.


What is the condition which should satisfy the lift $Y$ of $X$ such that every diffeomorphism


$$\beta\_t:p^{-1}(U)\to p^{-1}(V)$$


of this type leaves the connection $A$ invariant (more precisely it maps the restriction of $A$ to $\pi^{-1}(U)$ on the restriction of $A$ on $\pi^{-1}(V)$). 



Invariant connection by local diffeomorphism
Let $\zeta:\mathfrak g \to \Gamma(VP)$ be the infinitesimal principal right action, where $VP=ker(\pi)$ is the vertical bundle, and describe the connection $A$ equivalently as $\Phi=\zeta\circ\omega:TP\to VP$ where $\omega\in\Omega^1(P,\mathfrak g)$ is the principal connection form. This is the vertical projection associated to $A$. 
The connection is invariant under the flow of your lifted vector field $Y$ iff the Lie derivative of $\Phi$ along $Y$ vanishes: $\mathcal L\_Y\Phi =[Y,\Phi] = -[\Phi,Y]=0$. The bracket is the Frölicher-Nijenhuis bracket. See chapters 17 and 19 of [here](http://www.mat.univie.ac.at/~michor/dgbook.pdf) for more details. You could call $-[\Phi,Y]$ the covariant derivative of $Y$ with respect to the connection $A$.


