It is allowed for ref to change his mind up until the game is restarted. So even if he gave the goal, had a ciggy, chatted with the QPR players and then decided he didn't want to give the goal, he can, as long as the game hasn't restarted yet.
But if we had var, we'd still be sat here watching replays of it.