One recovery strategy in case of a major disruption in rail network is to cancel all trains on a specific line of the network. When the disturbance has ended, the cancelled line must be reinserted as soon as possible. In this article we present a mixed integer programming (MIP) model for calculating the best way to reinsert cancelled train lines in a rail network covered by a periodic timetable. Using a high abstraction level it has been possible to incorporate the temporal aspect in the model only relying on the information embedded in the train identification numbers of each departure. The model finds the optimal solution in an average of 0.5 CPU seconds in each test case.