Wednesday morning, Pip, Herbert, and Startop pick up Provis in the boat and head upriver. The boys are anxious but Provis is calm and delighted to be outside, saying imprisonment has given him the greatest appreciation for freedom. After a long day on the river, they stop for the night at a public house where they hear about a four-oared galley with two suspicious-seeming passengers. The man who describes them suspects the men were disguised custom house officers. Pip, Herbert, Startop, and Provis have all been wary of being followed and are disturbed by this news. While the others are sleeping that night, Pip can see through his window that two men are examining his boat.
Customs house officers sail the Thames searching for illegal activity. If they detect the boys' plot, Provis will surely be sent to jail.
Next morning, Pip, Herbert, Startop, and Provis row further upriver, meeting the scheduled steamer that Pip and Provis plan to flag down, climb aboard, and ride out of England. The steamer, though, is late and, just as Pip and Provis are bidding the others goodbye, the four-oared galley they'd heard about pulls up alongside them and one of the two passengers—a customs officer - identifies Provis as Abel Magwitch, and demands that he surrender. Provis leans across and pulls the cloak off the other man on board the galley—it is Compeyson. Compeyson staggers overboard, Provis falls with him, and Pip's boat overturns and sinks. Everyone but Compeyson manages to climb aboard the galley. Provis, badly injured, describes how he wrestled underwater with Compeyson. Back on shore, all of Provis' possessions—including the pocket book full of money—are confiscated.
Provis finally has his revenge on Compeyson just at the moment that Compeyson thinks he is getting his (unjust) revenge on Provis. Yet, as on the marshes at novel's start, Provis must pay for revenge with both his own freedom and the money he has earned over the years and planned to use to turn himself into a gentleman.
The customs officer gives Pip permission to accompany Provis back to London. Pip does his best to nurse Provis' wounds and comfort him. All of his "repugnance" for Provis has "melted away" and he sees him now as a kind, loyal, generous man, "a much better man than I had been to Joe."
Pip has finally matured out of his superficial class-consciousness and is able to recognize Provis' immense generosity and kindness. And in doing so, he can also see the ways in which he himself has been unkind.
On the boat back to London, Provis advises Pip to leave him for "it's best as a gentleman" not to be publicly associated with Provis. Pip refuses, telling Provis, "I will be as true to you as you have been to me." Pip realizes that all of the money Provis saved for Pip will now be confiscated by the crown but resolves not to tell Provis in order to protect Provis' dreams of "enriching" Pip.
Further evidence of Pip's growth: he is no longer worried about protecting his public reputation as a gentleman and instead prioritizes loyalty to personal relationships. He has also learned that one does not always need to tell the whole truth if you are acting conscientiously to protect another person.