When an accident or a natural disaster occurs in railways, it becomes impossible for trains to operate through the accidental area. Thus, in order to avoid further inconvenience of passengers, it is required to continue operating trains in other areas of the railway. This means we partially cancel trains and turn trains back to the neighboring stations in the accidental area. Although many papers about the rescheduling algorithm are published, none of them deal with partial cancellation and turning back of trains. In this paper, we propose a rescheduling algorithm that enables partial cancellation and turning back of trains. Our algorithm assumes a basic timetable while the duration of the accident is given, and it outputs a rescheduling plan in which the sum of the total delays and the penalties for cancellation is minimized based on mixed integer liner programming formulation.