Happened twice at the lake, I whipped the foil out of the lines instantly. Happened once in the surf, I struggled for a bit then gave up as the surge of the waves made it impossible, and released everything, swam in after it and unwrapped the lines from the mast. Then let the kite and bar wash onto shore.
Case by case. Assess it if you can, throw it all away if you can't.