Star Wars: The Rise of Skywalker is a movie that has virtually no time to slow down and catch us up on things that may have happened in the time between this film and The Last Jedi. It's a film so jam-packed with story that even the opening crawl contains a major revelation of the shifting fortunes of the galaxy, and that much plot means that little details are either left to the imagination or filled in by tie-in media. One such detail: Exactly how did Rey manage to get the Skywalker lightsaber back in working order? Thankfully, our trusty old friend the Visual Dictionary, written by Pablo Hidalgo, has the answers.
Way back at Star Wars Celebration in the spring of 2019, The Rise of Skywalker director and co-writer J.J. Abrams confirmed that the lightsaber originally owned by Anakin Skywalker "lives on" with Rey in some form, but he didn't say how. The saber was broken in two at the end of The Last Jedi as Rey and Kylo Ren each tried to Force pull it to their respective hands, but somehow the legendary weapon was restored and back in Rey's hands by the time of Episode IX. Unfortunately, the film itself doesn't shed any light on how Rey managed this, because there's no time to. She has the saber back, and what's important about it in the film is her determination to "earn" it from her new Master, General Leia Organa.
So, how did the saber wind up back in Rey's hands? Well, the short answer is that Rey repaired it, but how she repaired it is a little more interesting.
When the Resistance set up their new base in the jungles of Ajan Kloss, Rey set up a little workshop for herself among the trees, complete with a little "dehumicoil" chamber to keep the Sacred Jedi Texts now in her care safe from the rainforest humidity. Once there, she figured out how to repair the lightsaber, beginning with the Kyber crystal inside. As the Visual Dictionary explains, the Sacred Jedi Texts are not immutable, singular documents that have existed in the same form for millennia. They are a tapestry of constantly evolving Jedi thought and wisdom, filled with annotations and additions from masters through the ages, including Luke Skywalker himself. Because of this, the texts can be somewhat disjointed at times, and at other times they can lean heavily on metaphor, which means that even though Rey often uses translation programs to decipher their script, she has to trust her instincts in terms of the true meaning. She also, as we've already discussed, gets a little help from historiant-turned-Resistance-fighter Beaumont Kin.
It's the Sacred Jedi Texts and their many diagrams and annotations which contain the wisdom Rey needs in order to repair the lightsaber not just by finding a new crystal for it, but by healing the existing one inside. Using "techniques gleaned from Jedi scripture," Rey was able to preserve the original crystal for the saber. From there, it was simply a matter of repairing the mechanisms of the saber itself, welding the shaft back together, refitting the activator, and tying it all together with a leather strap.
Rey, no stranger to figuring out how spare parts and old machinery can be repurposed, was thus able to restore a legendary weapon that's had a role to play in three different galaxy-shaping wars. No wonder she was able to make a lightsaber of her very own by the end.