Measurements of longitudinal flow correlations are presented for charged particles in the pseudorapidity range |η|<2.4 by using a reference detector at 3.2<ηref<4.8 in Pb+Pb collisions at sNN=2.76and5.02TeV , respectively, with the ATLAS detector at the LHC. It is found that the correlation between the harmonic flow coefficients vn measured in two separated η intervals does not factorize into the product of single-particle flow harmonic vn . This breaking of factorization, or flow decorrelation, increases linearly with the η separation between the intervals. The linear coefficients of the flow decorrelation are found to be larger at 2.76 TeV than 5.02 TeV. The longitudinal flow correlations are also measured between vn of different order in n . The longitudinal fluctuations of v4 are found to contain significant contribution from the non-linear component from v22