SANTA CLARITA, CALIF. — “Deadwood” is back for one final hello and goodbye.

Last November, more than a decade after David Milch’s award-winning HBO series unexpectedly and maddeningly folded, Timothy Olyphant, as Seth Bullock, was once again in the center of the town’s perpetually muddy main drag, having words — heated, profane, Shakespearean ones — with Gerald McRaney, the show’s villainous George Hearst. From the balcony of the Gem casino, Ian McShane (Al Swearengen) glowered; offstage, Robin Weigert, the show’s foul-mouthed, tenderhearted Calamity Jane, waited in the wings.

Against all odds, the producers were able to reunite nearly all of the show’s principal cast for “Deadwood: The Movie,” the show’s much-delayed, much-anticipated finale. “I didn’t think it was ever going to happen,” Olyphant admitted later.

But if reassembling the show’s enormous ensemble cast 13 years on was a herculean task, reassembling the town of Deadwood itself was no less knotty, or crucial. The series is named “Deadwood” after all — the locale is just as important as any single cast member, the story of its 19th-century gentrification intertwined with the rising and falling fortunes of its inhabitants. So the filmmakers needed to get the place right.

The good news: They got to return to one of the most memorable and beloved towns in the history of television. Although “Deadwood” ran for only three seasons, it was nominated for 28 Emmys, winning eight, and is now considered one of the greatest dramas in TV history (earlier this year, The Times declared it one of the “20 best TV dramas since ‘The Sopranos’”).