I read a story a long time ago about a Civil War soldier who was being hanged from a bridge but the rope broke and he escaped. It goes through all the things he went through after escaping but then it turns out his neck was snapped and he died in the noose.
Wikipedia plot summary:
Peyton Farquhar, a civilian and plantation owner, is being prepared for execution by hanging from an Alabama railroad bridge during the American Civil War. Six military men and a company of infantrymen are present, guarding the bridge and carrying out the sentence. Farquhar thinks of his wife and children and is then distracted by a noise that, to him, sounds like an unbearably loud clanging; it is actually the ticking of his watch. He considers the possibility of jumping off the bridge and swimming to safety if he can free his tied hands, but the soldiers drop him from the bridge before he can act on the idea.
In a flashback, Farquhar and his wife are relaxing at home one evening when a soldier rides up to the gate. Farquhar, a supporter of the Confederacy, learns from him that Union troops have seized the Owl Creek railroad bridge and repaired it. The soldier suggests that Farquhar might be able to burn the bridge down if he can slip past its guards. He then leaves, but doubles back after nightfall to return north the way he came. The soldier is actually a disguised Union scout who has lured Farquhar into a trap as any civilian caught interfering with the railroads will be hanged.
The story returns to the present, and the rope around Farquhar's neck breaks when he falls from the bridge into the creek. He frees his hands, pulls the noose away, and rises to the surface to begin his escape. His senses now greatly sharpened, he dives and swims downstream to avoid rifle and cannon fire. Once he is out of range, he leaves the creek to begin the journey to his home, 30 miles away. Farquhar walks all day long through a seemingly endless forest, and that night he begins to hallucinate, seeing strange constellations and hearing whispered voices in an unknown language. He travels on, urged by the thought of his wife and children despite the pains caused by his ordeal. The next morning, after having apparently fallen asleep while walking, he finds himself at the gate to his plantation. He rushes to embrace his wife, but before he can do so, he feels a heavy blow upon the back of his neck; there is a loud noise and a flash of white, and "then all is darkness and silence". It is revealed that Farquhar never escaped at all; he imagined the entire third part of the story during the time between falling through the bridge and the noose breaking his neck.