I actually have a fangame where you can save Earth from a rogue planet (Persephone) by using the Protoian Solar Station, a space station from a powerful civilization that is friendly towards humans. You need to collect some parts that are scattered across some of Jupiter's moons. Once you do all that, you can place them in the station and you have the option to:
Send Persephone into the Sun.
Send it to Jupiter's orbit (thus it becomes its neighbour)
Send it to Saturn's orbit.
Send it to hidden planets (near Planet 9, 10 and some fictional bodies)