For non-linear surface waves there is, in general, ambiguity in splitting the total motion into a wave part and a mean part. As a consequence, there is some freedom in choosing the phase speed (celerity) of the wave.  identified two logical definitions of phase speed, known as Stokes's first and second definition of wave celerity:
#Stokess first definition of wave celerity has, for a pure wave motion, the mean value of the horizontal Eulerian flow-velocity Ū at any location below trough level equal to zero. Due to the irrotationality of potential flow, together with the horizontal sea bed and periodicity the mean horizontal velocity, the mean horizontal velocity is a constant between bed and trough level. So in Stokes first definition the wave is considered from a frame of reference moving with the mean horizontal velocity Ū. This is an advantageous approach when the mean Eulerian flow velocity Ū' is known, e.g. from measurements.
#Stokess second definition of wave celerity is for a frame of reference where the mean horizontal mass transport of the wave motion equal to zero. This is different from the first definition due to the mass transport in the splash zone, i.e. between the trough and crest level, in the wave propagation direction. This wave-induced mass transport is caused by the positive correlation between surface elevation and horizontal velocity. In the reference frame for Stokess second definition, the wave-induced mass transport is compensated by an opposing undertow (so Ū < 0 for waves propagating in the positive x-direction). This is the logical definition for waves generated in a wave flume in the laboratory, or waves moving perpendicular towards a beach.
As pointed out by Michael E. McIntyre, the mean horizontal mass transport will be (near) zero for a wave group approaching into still water, with also in deep water the mass transport caused by the waves balanced by an opposite mass transport in a return flow (undertow). This is due to the fact that otherwise a large mean force will be needed to accelerate the body of water into which the wave group is propagating.