By the night of February 14, the men running Fort Donelson had done the math and did not like the answer. The gunboats had been beaten, yes, but Grant's army was thickening on the land side by the day, the ring was closing, and at a council of war (a meeting of commanders to decide what to do) around 11:00 that night the Confederate generals agreed the fort was "probably untenable," impossible to hold. So they made a plan to punch their way out. The next morning they carried it out almost perfectly, opened a clean road to safety, and threw it away.
The plan had three parts and three generals, which was already a problem. Brigadier General Gideon J. Pillow (South) would lead the main assault straight south to seize Wynn's Ferry Road, the escape route running toward Nashville; Brigadier General Simon Bolivar Buckner (South) would hold the left as the men funneled out; and the senior commander, Brigadier General John B. Floyd (South), would coordinate the whole thing. A breakout is exactly this, a trapped force attacking outward to tear a hole in the ring around it and march its army through the gap before the enemy can close it.
The road thrown open
It worked. Around 5 a.m., Colonel Nathan Bedford Forrest's (South) cavalry stirred up a diversionary skirmish to the north to draw attention, and around 7 a.m. Pillow threw his full assault into Brigadier General John A. McClernand's (North) division on the Union right, the southern end of the line, facing the fort. McClernand's men bent, then broke backward; by early afternoon the Confederates had shoved the Union right back roughly 1 to 2 miles. The thing the whole plan was for had happened. The Union right was rolled up, the entire flank shoved sideways and backward, the defensive line folding in on itself, and with it gone, Wynn's Ferry Road lay open and the army's path to Nashville was clear. All they had to do now was walk out of it.

The order that gave it back
Instead, around 1:00 to 1:30 in the afternoon, after a morning of hard fighting and with the road to Nashville standing open in front of them, Pillow ordered the assault troops who had just bled to pry that road open to stop, turn around, and march back into the very trenches they had fought their way out of that morning. Out in the ranks, some of the men had been close enough to the open road to see it: daylight, the way home, no enemy across it. Then the order came down, and they marched away from it, back into the lines they had left at dawn.
Most historians call it one of the great command failures of the war, and it deserves to be treated as the genuine controversy it is. Pillow's stated reasoning was that his men needed to resupply and reorganize before setting out on the breakout march, and that the road would stay open long enough for them to do it. Floyd accepted the call. Buckner protested it on the spot and was overruled. Pillow himself never admitted any mistake; questioned about it afterward by Floyd, he said he was "conscious of the commission of no errors." Whether it was incompetence, a failure of nerve, or a real-time misjudgment about how long the road would hold, the men who knew best disagree, and the disagreement starts with Pillow insisting nothing went wrong at all. What is not in dispute is the result. The door the army had pried open swung shut while they stood in the trenches resting.
Grant comes back
Grant had not been on the field for any of this. He had been downriver meeting with the wounded Foote to sort out resupply for the battered fleet, and he had left no second-in-command, so his division commanders had spent the morning reacting on their own. When he rode back and saw his right broken and his officers shaken, he read the situation in a single sharp detail: the captured Confederate soldiers were carrying full knapsacks and haversacks, packed with rations for a march. Men loaded for a long journey are not pressing a sustained attack, they are trying to leave. The enemy was not winning. The enemy was running, and whoever moved first now would win the day. (His words to his staff officer Colonel J.D. Webster survive in several slightly different versions, all to the effect that the side that attacked first now would be victorious, and the enemy would have to hurry to get ahead of him.)
So he attacked first. He ordered counterattacks all along the line: McClernand to rally and retake the ground lost that morning, Brigadier General Lew Wallace (North) in the center to shift south and shore him up, and, on the left, Brigadier General Charles F. Smith (North) to hit the Confederate earthworks (the dirt walls and trenches the defenders had dug) that the breakout had stripped of men. His instruction to Smith was blunt: "All has failed on our right; you must take Fort Donelson." Smith took him at his word, climbed onto his horse out front where his men could see him, and drove his division straight into the outer entrenchments held by the 30th Tennessee, capturing them by evening. By about 5:30 p.m. the Union had retaken most of the morning's lost ground, and the trap was back in place, tighter than before. The escape was no longer just thrown away. It was gone.
"All has failed on our right; you must take Fort Donelson."