In the concluding paragraphs of Candide, is Voltaire recommending retreating from social commitment?
In Voltaire's Candide, I do not believe the author's recommendation is to retreat from social commitment.
Candide is a parody (a form of satire, making fun of an idea...) of Gottfried Wilhelm von Leibnitz and his philosophy that focused on optimism, mirrored in Pangloss' continual (and well-known) references to:
this best of all possible worlds.
More than anything, I believe Voltaire wishes people to be more realistic, and grounded rather than having a "head-in-the-clouds" attitude. Throughout the story, the most unrealistic and horrific events take place—leading to much suffering by Candide, Pangloss, and those they know and/or care about—and still Candide and Pangloss see the world with "rose-colored" glasses. However, as the story nears its end, Candide begins to question this philosophy.
Eventually Candide buys a farm where he and the other characters live. Advice from a kindly and neighboring Turk provides the turning point of Candide's personal philosophy—the Turk suggests that farming keeps one from life's vices:
I have only twenty acres of land...which my children and I cultivate. Our work keeps us free of three great evils: boredom, vice and poverty.
Candide changes his philosophy, greatly influenced by the Turk's words; and his outlook on life changes from "this best of all possible worlds" to "we must cultivate our garden."
In this the once easily-influenced Candide states that life is about avoiding vice, and paying attention to the things that matter most in life: being grounded in family and/or community, and making things grow; for there is only goodness in these things, and these are not the empty dreams of the eternal optimists.
Perhaps Voltaire is saying that "cultivation" is the better part of the bargain in life, as opposed to empty optimism. It is in the "cultivating" of the garden that the author presents his philosophy that in doing so, mankind shows an honest and sincere social commitment that creates results rather than intangibles, ideas, as suggested in von Leibnitz's philosophy.