Loss and revival of phase coherence in a Bose–Einstein condensate moving through an optical lattice