Rogue One: A Star Wars Story writers Gary Whitta and Chris Weitz recently took part in a live Q&A, and thanks to The Direct, we now have more details from their chat with IGN.
According to the writers, multiple endings were considered for the film, and there was one version where the only member of the "Rogue One" team to die would have been K-2SO. He was set to go out in a blaze of glory on the beaches of Scarif, the original location for much of the movie's final act (it's likely the team's survival was shot given what we saw in the trailers for the film).
Reshoots resulted in a lot of changes, though, and both Whitta and director Gareth Evans reportedly wanted to kill off every member of the group from the start. Disney disagreed, but when Weitz and director Tony Gilroy later came on board, they shot the ending as we now know it.
During the same interview, Princess Leia's surprise appearance at the end of Rogue One was also touched on. Initially, she was set to have a larger role in the film (like the CGI recreation of Grand Moff Tarkin), and the writers have her scenes in both the Rebel base and its War Room. Instead, it was decided that her appearing right at end of the movie would have a much bigger impact.
As a result, it was Felicity Jones' Jyn Erso who delivered that big speech in the War Room scene.
Oh, and going back to that sequence on Scarif's beaches for a second, Whitta and Weitz also confirmed that while Jyn was stealing the Death Star plans, Darth Vader would have been trying to get to her by mowing down Rebels below. Needless to say, that would have been awesome to see!