A few days into shooting the “Deadwood” movie, David Milch had the show’s cast and crew in tears. On most mornings at the film’s Melody Ranch set in Santa Clarita, Calif., Milch would start the day by giving a pep talk. But this one was extra wistful.

“It was the third day of shooting when he came on and read a speech that basically talked about why we’re all back,” says executive producer Gregg Fienberg. “And it had to do with the scene and what was going on in the scene, and talking about how the characters are coming back. But it also was expressing what it’s like for all of us as a group of filmmakers to come back. Everyone on the set, if they weren’t crying, they were choked up and trying not to.”

Ian McShane, who plays hard-living Gem Saloon proprietor Al Swearengen, also was caught up with emotion during the shoot. “Milch makes a little speech about what the scene’s about, and then you look at the other actors, actors you haven’t worked with for 13 years who you trust with your life, and they’re all terrific,” he says. “It just overwhelms you.”

More than 12 years after the unexpected end of the HBO drama, the whiskey’s flowing again in “Deadwood” — at least for a two-hour movie. And the timing is a bit poignant, following the recent revelation that Milch has been diagnosed with Alzheimer’s disease.

Milch’s news, unfortunately, is now tied to what’s otherwise a joyous return. The writer tells Variety he’s heartened by the reaction he’s received: “I’d put off letting people know I was sick, but confronting the fact was an inevitability,” he says. “People have been very generous.”

“Deadwood” wasn’t supposed to end the way it did. Back in 2006, a conversation between Milch and then-HBO head Chris Albrecht about Milch’s next project, “John From Cincinnati,” turned into a discussion about how many more episodes it would take to wrap up “Deadwood.” Albrecht suggested Milch do a final season of six episodes, instead of 12, but Milch took that as a sign to move on, and started telling people that the show was over. Soon the news leaked to the press, and any talk about keeping the series going stalled. Speaking at the TV Critics Assn. press tour that year, Albrecht said it was a big misunderstanding that became permanent. “I think we would all like to revisit the phone call,” he said. “It just got a little bit ahead of itself.”

Almost immediately the conversation turned to wrapping up “Deadwood” with two movies. But as the years went by, Milch was busy with other projects — after “John From Cincinnati,” he created “Luck,” also for HBO. Neither show lasted, but time kept marching and the “Deadwood” stars went to other vehicles. Timothy Olyphant starred in FX’s “Justified,” McShane moved to “Kings” and “American Gods,” Anna Gunn went to “Breaking Bad,” and so on. The question of a revival would pop up virtually every year at the TCA press tour, even as HBO moved from one network president to the next, but there was never any answer.

McShane kept in touch with Milch, and every once in a while the subject of “Deadwood” would come up. “I’d see David a couple of times a year, for breakfast or what have you,” he says. “And I’d email him occasionally. The last three or four years, he’d say, ‘Maybe,’ and I’d say, ‘Forget about it. Get on with your life. What the hell!’ And then it started happening in spades when he started writing down the opening sequence a couple of years ago.”

By the end of 2017, a movie script (just one, rather than the original plan for two) emerged — and talk finally turned to making the “Deadwood” movie happen. But Olyphant, who’s back as Bullock, the hardware store owner who eventually becomes Deadwood’s sheriff, wasn’t convinced it was a good idea.

“I’ve always enjoyed going back to high school reunions, but I don’t think I’d ever show up to redo my sophomore year,” he says. “I always wanted to work with David Milch again, but I wasn’t sure that revisiting ‘Deadwood’ would be creatively enjoyable. There’s quite a challenge about going back to essentially give a performance that you gave a long time ago. It’s a bit tricky when someone says, ‘Well, you can do it again, but you kind of have to do it the way you did.’”

Lazy loaded image
Courtesy of Warrick Page/HBO

Olyphant eventually came around, and now says he’s glad he did. “I underestimated how much I missed it and how much I missed those people,” he says.

Although no one mentions Milch’s diagnosis, it surely added an extra bit of motivation.

“There comes a time when, if you’re going to do something, you have to do it,” Fienberg says. “And I think we reached that time. He had been working on it and started to solidify a really strong story.  As David would say, ‘Sometimes you’ve got to grab your balls and jump!’ So for HBO that time had come.”

After that, it was serendipity: Both Olyphant and McShane had time toward the end of 2018 when they weren’t shooting their own shows. And as luck would have it, the Melody Ranch was available during that period. “Then we started warning everybody else and turned on the jets,” Fienberg says.

Most of the key cast members who are still alive (Powers Boothe, who played Cy Tolliver, died in 2017) were available, with the exception of Molly Parker (who plays Alma). But production on her Netflix series, “Lost in Space,” managed to accommodate her schedule enough that even she was able to return.

Using the hook of South Dakota’s 1889 statehood as a way to bring the show’s characters back into town couldn’t have worked out better. “The story is about the passage of time, and like a lot of great stories, it’s about chickens coming home to roost,” Olyphant says. “And it’s about a community that’s experiencing change, and asking if it’s not only going to survive it, but is it going to walk into the future with any sort of optimism?”

McShane marvels at how easy it was to get back into character as Swearengen, whom he always saw as a bit of a stand-in for Milch himself — and, of course, his penchant for colorful cuss words.

“It didn’t take any time at all,” he says. “Just put on those sweaty old long johns, which I don’t think they’ve washed in the past 12 years. At least I hope they haven’t.”

For production designer Maria Caso, who had been with “Deadwood” since day one (and won an Emmy for the show in 2005), the challenge was to not only re-create the set but also update it to reflect a decade of progress. That included tearing out things that had been built for more recent productions, and having to rebuild Bullock’s house (which had been demolished for “Westworld”).

Because blueprints for the sets had long disappeared, Caso and her team had to look at photos and footage from the original series to reconstruct things as best they could. By statehood, Deadwood had a train, some electricity and a town telephone, and structures were rebuilt with brick (except for stubborn Al’s saloon, that is). There was even an oyster bar that shipped in the raw delicacy from the coast.

“You never imagine you’ll go back on a show you loved,” Caso says. “The show was canceled so abruptly, and it was really traumatic for all of us. It was a thing of passion. To come back years later, it’s just surreal. And this time we have all of the people who want to be here, and they all love David.”

Then there’s Milch himself, who calls the reunion “a gift,” adding, “The artistry and excellence of those who returned has never been more evident. It’s the greatest affirmation of hope and purpose I could ask for.”