He did use rest to wake up, but of course, he was gagged so the quaff attempt failed. He stood do do unbind, but of course got bashed. Should have spammed flee;quaff though, since fighting almost always knocks out the gag. At the point he stood had little hope, since the second he stood he was going to be lagged, that he got a flee in was lucky, though it looks like it was wimpy. But if instead of doing unbind he went with a flee;quaff he may have survived, since the fighting knocked out the gag and the thief left him potions in inventory.
Surprised the thief did not steal those potions to be honest, to prevent the escape attempt and ensure death.