Battle Angel Alita: Last Order.
Really great manga, story would be to complicated to explain fully, but at the end of it, Alita, whose brain had been taken out and replaced by a computer chip that had a copy of all her memories, ends up going to Mars to find out the mystery behind her past.
However, she knows she most likely wont come back from it alive, and thus would be unable to fulfill her promise to Figure Four, her boyfriend she met on Earth, so she has her original organic brain put inside a organic clone of her body, since she, Alita 2, has an android body, so that the "real" her, the real "original" Alita in her actual organic brain, the Alita that fell in love with Figure in the first place, could spend the rest of her life happy with Figure Four, and her friends back on Earth, without having to know all the pain and suffering she, the brainchip "second" Alita, has gone through in the months since her brain was removed and replaced with a computer chip.
Its a really sad ending, even though technically everyone gets what they want.
But I think it ended like it should have.