When a wave approaches the coast it starts to rear up. Eventually the wave breaks and a white foaming crest appears. Whitewater by the coast is surf.
When the breaking waves moves onshore it is called swash; when it flows back offshore it is called backwash.