  We analyze charge order within the the spin-fermion model. We show that
magnetically-mediated interaction gives rise to charge order $\Delta_k^Q =
\langle c^\dagger_{{\bf k}+{\bf Q}} c_{{\bf k}-{\bf Q}}\rangle$ with momenta
${\bf Q}=Q_x =(2Q,0)$ and ${\bf Q}=Q_y =(0,2Q)$, if the magnetic correlation
length $\xi$ exceeds some critical value. We argue that $\Delta_k^Q$ and
$\Delta_{-k}^Q$ are not equivalent, and their symmetric and antisymmetric
combinations describe density modulations and bond current. We derive GL
functional for four-component $U(1)$ order parameters $\Delta^Q_{\pm k}$ with
${\bf Q} = Q_x$ or $Q_y$. Within mean-field we find two types of CDW states, I
and II, depending on system parameters. In state I density and current
modulations emerge with the same ${\bf Q} = Q_x$ or $Q_y$, breaking $Z_2$
lattice rotational symmetry, and differ in phase by $\pm\pi/2$. The selection
of $\pi/2$ or $-\pi/2$ additionally breaks $Z_2$ time-reversal symmetry, such
that the total order parameter manifold is $U(1) \times Z_2 \times Z_2$. In
state II density and current modulations emerge with different $\bf Q$ and the
order parameter manifold is $U(1) \times U (1) \times Z_2$. We go beyond
mean-field and show that discrete symmetries get broken before long-range
charge order sets in. For state I, the system first breaks $Z_2$ lattice
rotational symmetry ($C_4 \to C_2$) at $T= T_n$ and develops a nematic order,
then breaks $Z_2$ time-reversal symmetry at $T_t < T_n$, and finally breaks
$U(1)$ symmetry of a common phase of even and odd components of $\Delta^Q_{k}$
at $T= T_{\rm cdw} < T_t < T_n$ and develops a true charge order. We argue that
the preemptive orders lift $T_{\rm cdw}$ and reduces $T_{\rm sc}$ such that at
large $\xi$ charge order may develop prior to superconductivity. We obtain the
phase diagram and present quantitative comparison with ARPES data for
hole-doped cuprates.
