After Watney crawls back to base and patches himself up, he sets himself a task in a video diary to create more oxygen, and figure out how to make his rations last.
The oxygen and water part seems easiest - the stranded rocket has reserves of nitrogen and other elements that he burns to create oxygen inside the base. Watney then separates out his rations, which will only last a few months. While taking 'a rest', he is suddenly struck with inspiration.
He collects all his vaccumed dumps, and uses it as fertiliser - along with a water sprinkler system - and grows more potatoes from his rations.
Meanwhile, back on earth, NASA are looking at stop-footage from Mars, and can see that Watney has survived and is busy moving things around.
Watney knows he will need to travel across the planet to meet up with the next crew - but his buggy lacks the juice. He tries to skimp on heating, but knows he won't survive - so his only option is to dig up a buried nuclear power cell to keep him warm, not too concerned with his long-term health.
Next, Watney goes on a mission to find a stranded Mars Rover, and takes it back to base. He configures the communication panel, and can beam back pictures to Earth. Using signs, and Nasa controlling the Rover's direction, they can transmit signals, where they tell him how to wire it so they can type to each other. And now we're moving!
Watney sends messages home, debates botany with top scientists, and prepares to wait for a mission from Earth to bring him home.
Back on Earth, Nasa are working around the clock to ready the next rocket to take a crew on a rescue trip. They cut corners, and during launch the rocket explodes.
Watney isn't doing so well either - while on one of his many strolls around Mars, the airlock blows off its hinges - all oxygen escapes from the base, and the Mars atmosphere instantly destroys his crops - and apparently due to a lack of bacteria, he can't repeat his fertilisation trick again.
Just when all is looking desperate, a strange scientist has a theory that the returning crew can slingshot past Earth, pick up a supply ship, and get back to Mars quicker. Those on the trip back are shocked to hear that their old crewmate is alive, and all agree to spend another 2 yrs in space to rescue him.
The manned-shuttle does it trick, and Watney starts his long journey across Mars in the buggy. He finally reaches the second launch site, gets into space in a flimsy looking rocket, and after a bit of drama, manages to make it on board to the relief of everyone.
Years later, he is back at Nasa teaching new recruits about the perils of space. His captain is a home with her family, two of the others are married and about to have a baby, while Michael Pena is ready to go back.