Under study is an integrable geodesic flow of a left-invariant sub-Riemannian metric for a right-invariant distribution on the Heisenberg group. We obtain the classification of the trajectories of this flow. There are a few examples of trajectories in the paper which correspond to various values of the first integrals. These trajectories are obtained by numerical integration of the Hamiltonian equations. It is shown that for some values of the first integrals we can obtain explicit formulae for geodesics by inverting the corresponding Legendre elliptic integrals.