This is the basis of phase-contrast angiography.
Stationary spins undergo no net change in phase after the two gradients are applied.
Moving spins will experience a different magnitude of the second gradient compared to the first, because of its different spatial position. This results in a net phase shift. This information can be used directly to determine the velocity of the spins. Alternatively, the image can be subtracted from one acquired without the velocity encoding gradients to obtain an angiogram.