Before his hulking circuited body gave out protecting his friends K-2SO linked his consciousness into the main computers to find himself a way out. Chasing the pulsing electricity through the wires and reading the vast coding of 1's and 0's he disappeared onto the information super highway

Jyn Erso, daughter of an empirical scientist and creator of the planet killer; deathstar, had done it. She had proven her father innocent, beamed the information to the rebellion, and now she dragged the dying body of Cassian Andor to the beach to watch their impending death approach from the kyber crystal blast. The Death Star had come to stop her. It blocked out the sky and her hope.
She fell to her knees in the sands of Scarif the beautiful paradise planet had been an Empire base, and now it was about to be nothing. They had watched the destruction of planet Jedha and knew the same fate awaited this planet. Cassian squeezed her hand as they watched the great light beam shoot down from the Death Star. She could almost cry, it was so beautiful to watch but also so terrifying. She had done her job, possibly allowed the resistance to stop this great evil, but she wished she could keep fighting.
Cassian now openly bled from his wounds, she was amazed he was still conscious. There was no point to staunch the bleeding, they would be dead soon. They both continued to watch the horizon come flying closer to them and almost didn't hear the ship behind them touch down.

K-2SO no longer needed a body, he wondered for a nanosecond if this is what happens when other androids died, but doubted it. He had bypassed every firewall preventing the hacking of empire ships and found one impounded small escape pod. He directed it to where he has seen Jyn heading on the beach from a video surveillance camera. He found their heat signals easily and was greatful this ship was equipped with a health bay as he watched his friends vitals fall.

Cassian turned his head at the sound, and grabbed Jyn to alert her to the pod that had appeared behind them. They were both startled but moved quickly onto the ship with renewed energy. The Death Star's planetary destruction was nearly upon them, a tsunami of destruction rushing ever faster. Seconds after they stepped on board they heard K2 announce himself over the intercom on board and led them to the medical supplies as he took off remotely just before their oncoming demise.
The last thing Cassian remembered was Jyn softly playing with his hair telling him it was okay to sleep now as the MedBay robot arms cleaned, disinfected, and stabilized him. He felt no pain and saw only light and thought how nice this would be if it were real.

Many years later Jyn woke him up in her sleep. Another nightmare from those times of abandonment and fear. They no longer feared either the rebellion or the empire, they had traveled to one of the furthest planets their pod could reach, and then K2 forged them papers as workers in a new developing planet in the far reaches of the known solar system.
There they settled down. They bought a K-2SO approved android body that was missing some components that he easily grafted himself into. They owned a small but live-able farm and had a child. Nearly a decade passed them by undiscovered, but Jyn was obviously still scared.
Cassian slid from their bed, allowing Jyn her restless sleep. She liked to kick and punch and claw at anything during her nightmares and it was usually best to be far away till it passed. He chuckled to himself as he moved from the bed and watched her fitful sleep until dawn.