He went back in time to ensure that he died when the engine fell onto the house, as his survival caused the time rift that would kill his mother and sister. At least that's the "official" explanation. I personally think it makes more sense that it's all a dream he has as he dies (after all, "the dreams in which I'm dying are the best I ever had"). P.S., I consider the film to be greatly over-rated and long for the day that people finally realise that it wasn't so hot after all.