The rotor walk on a graph is a deterministic analogue of random walk. Each vertex is equipped with a rotor, which routes the walker to the neighbouring vertices in a fixed cyclic order on successive visits. We consider rotor walk on an infinite rooted tree, restarted from the root after each escape to infinity. We prove that the limiting proportion of escapes to infinity equals the escape probability for random walk, provided only finitely many rotors send the walker initially towards the root. For i.i.d. random initial rotor directions on a regular tree, the limiting proportion of escapes is either zero or the random walk escape probability, and undergoes a discontinuous phase transition between the two as the distribution is varied. In the critical case there are no escapes, but the walker's maximum distance from the root grows doubly exponentially with the number of visits to the root. We also prove that there exist trees of bounded degree for which the proportion of escapes eventually exceeds the escape probability by arbitrarily large o(1) functions. No larger discrepancy is possible, while for regular trees the discrepancy is at most logarithmic.