Andy Murray looked to have buried Bernard Tomic, but the Australian managed to pull off the unthinkable.