Unfortunate for them that their country would self sabotage the way they are about to, but look at it from European perspective. The UK is the most anti-EU country currently in the Union. It has the most dissenters, their representation in the EU is a farce, their media shits on the EU daily and a whole lot of their politicians are against the EU too.
They are actively sabotaging the most peaceful and prosperous era in the history of this continent. The EU depends on all member states being all in on the project. If by some miracle the UK manages to not leave, a huge part of the mass media and nearly half the population will still be against the EU, and that's not going to magically change just because the country got saved in the last moment.
The cat is already out of the bag and consequences must be met. Leaving is the only way for the UK to fix their identity crisis. They can reapply to join again once that's done. I'm sure the EU won't turn them down.