  We studied the anisotropy of the superconducting upper critical field $H_{\rm
c2}$ in the heavy-fermion superconductor UTe$_2$ under hydrostatic pressure by
magnetoresistivity measurements. In agreement with previous experiments we
confirm that superconductivity disappears near a critical pressure $p_{\rm c}
\approx 1.5$~GPa, and a magnetically ordered state appears. The unusual $H_{\rm
c2}(T)$ at low temperatures for $H \parallel a$ suggests that the multiple
superconducting phases which appear under pressure have quite different $H_{\rm
c2}$. For a field applied along the hard magnetization $b$ axis $H_{\rm c2}
(0)$ is glued to the metamagnetic transition $H_{\rm m}$ which is suppressed
near $p_{\rm c}$. The suppression of $H_{\rm m}$ with pressure follows the
decrease of temperature $T_{\chi}^{\rm max}$, at the maximum in the
susceptibility along $b$. The strong reinforcement of $H_{\rm c2}$ at ambient
pressure for $H \parallel b$ above 16~T is rapidly suppressed under pressure
due to the increase of $T_{\rm sc}$ and the decrease of $H_{\rm m}$. The change
in the hierarchy of the anisotropy of $H_{\rm c2}(0)$ on approaching $p_{\rm
c}$ points out that the $c$ axis becomes the hard magnetization axis.
