Since the scale of May's defeat makes it very clear that the Withdrawal Agreement can't pass, and since May has apparently suggested that she's now (somewhat belatedly, some might say) prepared to talk to the Opposition about a more bipartisan approach, I think the first order of business has to be to go back to Brussels to ask for more time while the UK tries to sort out what on earth to do next.
Since the EU certainly don't want the UK to crash out without a deal, I think that request will probably be met with quite sympathetically. It may be that both party leaders will be able to agree a much softer Brexit -- without a lot of the problematic red lines -- that they could hope to sell to their respective parties, but I think one way or the other, a second referendum will have to be part of the final decision-making process, possibly a binding referendum which either ratifies the soft Brexit agreement or opts to Remain and automatically cancels A50 irrevocably.
That, I think, would provide a route to a solution the EU and the UK government and opposition could live with, and would probably end up with the second referendum cancelling Brexit completely.
But first things first -- May has to ask the EU for more time and to pass legislation back home that stops the clock on the EU (Withdrawal) Act. And I think that when that happens, the chances of Brexit actually happening go way, way down.