THE HISTORY of U.S. politics is full of second chances — of scandal-scarred, disgraced and irredeemable public figures staging improbable comebacks — but few back-from-the-dead narratives have been as swift and sure-footed as the one Virginia Gov. Ralph Northam has managed this year.

Since Feb. 1, when the discovery of a racist photo on his medical school yearbook page dealt what seemed a lethal blow to his political career, Mr. Northam has refocused his governorship on racial equity and reconciliation in what amounted to an extended act of public contrition and atonement. It has been astonishingly effective not just in terms of his own political rehabilitation — his poll numbers climbed from the depths — but also in setting a clear theme for his four-year term in office, delimited by Virginia’s prohibition on governors succeeding themselves.

In the process, Mr. Northam, a Democrat, persuaded many Virginians to allow him a season of penitence. Not least among them are African Americans who were stunned when the governor first admitted, then denied, appearing in the photo in which one figure is in blackface and another is in a Ku Klux Klan costume, while adding that he did don blackface, appearing as Michael Jackson at a dance contest, the same year the yearbook was published.

In February, most of Virginia’s lawmakers, Democrats and Republicans, called on him to resign, as did an editorial on this page. Few of those calls were repeated for long, although the question of who is in the photo, if it is not Mr. Northam, remains unanswered. It helped Mr. Northam that his potential Democratic successors were quickly enmeshed in their own scandals, which shifted the spotlight and forced his party to consider whether it would prefer a Republican governor. (It wouldn’t.) It helped that Virginia Republicans, rarely bothered by President Trump’s race-baiting, lack any credibility to criticize Mr. Northam, a former lawmaker whose record on race was strong before he was elected governor in 2017.

Most potent, it helped that he set himself an agenda on racial equity and pursued it single-mindedly. Scarcely a week or month has passed without Mr. Northam visiting a racially significant site, seeking out counsel from black leaders or announcing an initiative to advance racial justice. He hired Virginia’s, and possibly the nation’s, first state director of diversity, equity and inclusion. He established a commission to comb state law for racist language and provisions, much of it left over from the Jim Crow era. He ordered measures to expand access to state contracts for women- and minority-owned firms, to which less than 3 percent of state contracts were awarded a decade ago. He set up a commission to recommend reforms in the way black history is taught in Virginia’s public schools.

This month, in Mr. Northam’s first biennial budget, he proposed an array of programs that would help less affluent and minority communities, including offering free community college to low- and moderate-income students, expanding prekindergarten for at-risk and disadvantaged children, and boosting funds to reduce maternal mortality among women of color.

Throughout, Mr. Northam, a self-effacing pediatric neurologist, has expressed remorse and projected what many Virginians regard as genuine humility. “I’ve had to confront some painful truths,” he said in August at an event commemorating the arrival 400 years ago of the first African slaves in North America, where Hampton, Va., is today. “Among those truths was my own incomplete understanding involving race and equity.”

That speech earned Mr. Northam a standing ovation from a crowd that was heavily African American. Quite a comeback, and a hard-earned one, for a governor who could scarcely show his face in public in February.

Read more: