The only stakes as dire as those featured in the episode were those faced by the people that wrote it. While "Yesterday's Enterprise" often ranks as an all-timer for both the franchise and science fiction in general, its development process was so convoluted and stressful that one of its co-writers, Ira Steven Behr (Star Trek: Deep Space Nine, The 4400), still can't believe to this day how well-regarded the hour is. Or that they managed to pull it off. To celebrate the 30th anniversary of "Yesterday's Enterprise," co-writers Behr and Ronald D. Moore recently gave The Hollywood Reporter an oral history of sorts behind one of the greatest (and hardest) episodes they've ever made — one that would ultimately end up saving the series.

Fans have not let history forget "Yesterday's Enterprise," the classic episode of Star Trek: The Next Generation from which that line comes. Thirty years ago this week, Captain Picard (Patrick Stewart) and the Enterprise crew encountered Captain Rachel Garrett (Tricia O'Neil) and the crew of the long-lost Enterprise-C, when a temporal anomaly altered the timeline and brought the two starships together. But the twist is, in this version of the 24th Century, the Federation is on the losing end of a long war with the Klingons. This war could be over before it started, Picard posits, if the Enterprise-C returns to its proper timeline — but not without her crew losing their lives to save millions of others in the process.

A Next Generation production staff member, Eric Stillwell, and his friend and writing partner, Trent Christopher Ganino, originally submitted the episode as a spec script via TNG’s famous “open door policy,” which was started by the then-showrunner, the late Michael Piller. (Before this draft, Moore recalled seeing another draft — one that “hovered somewhere around 90 pages or so” — from Ganino and another writer.) That Stillwell-Ganino draft is what Piller handed Moore to work with in early fall of 1989, as Moore was then brand new to the writing staff.

"The original episode and pitch are very different from what we ended up writing," says Moore.

“It was my first year on staff,” Moore recalled, “and it was one of the first things Michael Piller handed to me and said: ‘See what you can do with this, it isn’t working, but I think there’s an episode in here.’ He gave me that and he gave me the episodes that became [the Worf episode] ‘Sins of the Father.’”

That draft Moore inherited did not include the two key elements that Moore would add that ultimately helped get the episode greenlit: The war with the Klingons and the arrival of the Enterprise-C altering the timeline. "Everyone on [Picard's ship] in the original draft that I had, the crew, they all knew of the Enterprise-C and what happened to them, that they died in some incident," Moore says. "But no one on the other crew knows this, so Picard and his people, they're trying to get the C back to its timeline and keep all this a secret."

Moore also made the other Enterprise's captain a female when he took the first pass on the episode. (The return of the deceased Tasha Yar, played by Denise Crosby, to this altered timeline was already in play early on.) The original script also featured a senior officer from the Enterprise-C spending most of the episode "with Data on the holodeck, having some sort of epic pirate movie-type adventure, singing songs and — it was crazy. It was just so expensive, too — you couldn't do it, budget-wise — so it was obvious we'd cut it."

Thanks to Moore's re-shaping of the episode into something more in line with the type of sci-fi Trek was putting out at the time, Piller approved it for production. But, had season three not been "in chaos," as Behr put it, there's a chance the episode would have never made it out of development hell.

"What's important to understand," Behr says, "is that we were so far behind on episodes [in season three], we were so backed up with shows, so it was just like putting out fires, you know? But there had been this story that there was interest in, from Eric Stillwell, and we needed to put something in the pipeline for production."

"It Was Such a Clusterfuck"

Faced with a deadline to get the episode written in time to go into production before Christmas — in order to accommodate schedules for guest stars Denise Crosby and Whoopi Goldberg as Guinan — Behr was put in charge of overseeing completion of the final draft. He enlisted writers Moore, Richard Manning and Hans Beimler for the task, with each writer taking on acts. That meant that the writers had to spend Thanksgiving weekend of 1989 hammering out the script.

“That pissed everyone off to no end,” Behr says with a laugh. “But that was the job. Michael, at the time, was not able to — or didn’t want to — deal with the writing staff on a day-to-day basis, for something like this. He was, justifiably, too busy rewriting and dealing with everything else, because we were so behind that season. It was such a clusterfuck. He said: ‘Get them in, we gotta do this.’”

"I took the teaser and act one," Moore recalls. When the alternate timeline kicks in, Moore really enjoyed writing that and calling out, visually, what that would like on the bridge.

The episode’s opening scene, between Guinan and Worf in the Enterprise-D’s bar lounge, Ten Forward, originally featured a very non-Trek exchange between the two characters.

“Originally, I had Guinan talking to Worf about the stars. About how, when humans look at the stars, they often ask questions of them,” Moore explains. In Moore’s original version of that scene, Worf’s reply was something to the affect of “when Klingons look to the stars, it’s more ‘what do the stars make us ask of ourselves’?” Executive producer Rick Berman ultimately cut that compelling exchange, but Behr made it known to the rookie writer how big a fan he was of that scene.

“What was great about it was, I remember Ira pulling me aside in the hallway to tell me basically he liked those lines,” Moore recalls. “He appreciated that there was a poetry to them and I remember that stuck with me for a long time because, again, it was my first year. I was a new writer, and I remember thinking it was so kind of him to take the time to do that.”

Moore relished the idea of working in an alternate universe.

"It was fun to me, this idea of a darker, Next Generation universe, to change the little things like — when I got to write the draft of the actual shooting script, I was describing the new bridge and I made a point of lifting the Captain's chair up higher, more like [how it was] on The Original Series." Moore also noted in his draft that the lighting would be darker on the bridge, and everyone would have sidearms. "Differentiating the Enterprise we knew for this alternate reality Enterprise, that was the most fun for me," says Moore.

Moore also volunteered to tackle the fifth and final act of the teleplay, where the Enterprise-D's crew goes out in a literal blaze of glory defending the Enterprise-C's trip back in time from attacking Klingon Birds of Prey. This act infamously features an explosion that horrifically kills alternate timeline Riker (Jonathan Frakes). Originally, the plan was for all of the bridge crew — Data (Brent Spiner) and Wesley Crusher (Wil Wheaton) included — to go out in similar grizzly fashion.

"My memory is that Rick Berman [TNG executive producer] pushed back on that and didn't want to see everyone on the bridge die," Moore says. "So I pulled back on what my original intention was, but [writing it] was a ball." (Behr recalls that they actually did shoot those death scenes, which were spurred on in part by the frustrations the writers faced having to work over the holiday weekend. According to Behr, he believes those scenes were cut because "they were too violent and didn't really sell as well [the drama] in the final cut." And that Rick Berman wasn't a fan of them because they "could have felt too depressing for the fans" to end the episode on.)

A fun beat for Behr during the climactic battle was having Picard as the last man standing on the bridge, at the tactical console, literally going down with the ship as flames and smoke consumed the bridge.

"That is a callback to the last shot of Bataan," Behr reveals, referring to one of his favorite World War II movies from 1943. Behr also is quite fond of Stewart's line during this scene — "That'll be the day" — as it delivers on the John Wayne-like tone Behr intended for the line to be delivered in.

Watch "Guinan's Intuition" 'Star Trek: The Next Generation' "Yesterday's Enterprise"

The Hardest Scenes to Write

"The Guinan scenes were always impossible," Moore says. Both he and Behr agreed that that was the case, no matter what episode the Enterprise's enigmatic alien bartender (played by Whoopi Goldberg) appeared in. Here, they are referring to Guinan and her sage-like interactions with Picard, where she explains the timeline has been altered without fully explaining it.

"Michael personally wrote the Guinan-Picard stuff," Moore says. "He loved the character of Guinan, he loved the idea that Picard had a relationship with the bartender."

Both Moore and Behr remember Piller did the final pass on those scenes, after a constant back-and-forth notes process. Those scenes went through a lot of rewrites — "What is she saying, what is she not saying," according to Moore. The struggle was how much exposition could Guinan dish out before it felt too much or made Picard's job too easy in regards to the fate of the Enterprise-C. So Piller was the closer on those beats, but that's not to say Piller only focused on those.

"He did a [showrunner's] pass on the final draft," Behr said. "It was all hands on deck, but out of that chaos came kind of a [...] cultural touchstone, I guess, in terms of the genre."

"This Doesn't Look Terrible"

That's what Behr said during post-production, while watching footage from "Yesterday's Enterprise" come in.

Behr remembered that TNG was just coming off one of the hardest episodes, the Rashomon-style murder mystery "A Matter of Perspective," and "morale was low, things were — they weren't looking too good."

"The thing that started to give us hope, that this was actually going to be good — and Ira has said this many times before — was seeing the dailies," Moore adds. "And seeing that lighting on the bridge. It was just so interesting to see this darker take on what we all knew take shape and the performances were great, the action… it just looked like it was going to work."

The end result ultimately reinvigorated both the show and the creative staff at the time. And while the episode deservedly has its fans, among them was not the man who gave it the go-ahead.

"I don't think [Michael] loved it," Moore says of his former boss. "Michael, like me, was still in his first year, too. He wasn't sure how bold you can be on the show, of the feel of the show yet. I think the notion of the alternate universe was a little daunting for him on some fundamental levels. He was still kind of figuring out not only science fiction, but Star Trek's take on science fiction. I don't think he was overly enthusiastic about [the final episode], but again, from the beginning, he did see the potential of the script. And that's why he gave it to me and that's why he put it into the pipeline."

Thirty years later, Piller's decision more than holds up. And as great as "Yesterday's Enterprise" is, it is a source of some regret for one of its key creative architects.

"I wish we did this as the plot for Generations," Moore says, referencing the first Star Trek feature film featuring The Next Generation crew that he co-wrote with Brannon Braga. "If we hadn't have done that episode, then [the movie] would have been the Enterprise-A coming through that wormhole, and you'd have Spock and Kirk and everyone on that ship, we'd play the same story. They — the original crew — they had to go back to their deaths. And Guinan knew Kirk, and Guinan knew Picard, and that would have been an amazing movie."

Guess we will just have to settle for having an amazing episode.