Obito blinked. "So, in exchange for a Sharingan being permanently blinded, you can make a genjutsu turn into reality." The half-faced Uchiha spoke, continuing to blink owlishly.
"Yes, so you can use it as an absolute last resort if you need to escape even Death itself-" Madara continued his explanation, but then he himself blinked as he realized Obito had taken the time to Kamui the fuck out of there. "... For some reason, I feel very stupid right now..." Madara admitted, resigning himself to being alone in the cave again. "Oh, well, he'll be back, eventually. I need to pass the time... One million bottles of beer on the wall, one million bottles of beer, take one down..."
Meanwhile, Obito was looking at where Kakashi had buried Rin. It took him a few minutes of digging to remember he knew some Earth jutsu to pull her out without digging. Let it not go unsaid that Obito is an idiot. Then he used his not inconsiderable ability in genjutsu (he had a Mangekyo, he didn't need to actually be decent at anything, the Sharingan did it for him) to put a genjutsu on himself, to make himself see Rin as if she was alive and well instead of dirty, half-rotted and missing a big chunk of her chest.
Then he used Izanagi.
The line between illusion and reality was erased for a second, Obito rejected reality and imposed his genjutsu over it. And thus Rin was alive. Then he used Kamui to teleport them both to Konoha.
"Man, I'm sure glad Madara gave me a spare Sharingan for the other eye socket, else I would've had to give up my hax eye powers." He admitted, as they got there.
Rin looked as if he had just come back from the dead. Well, half of him anyway.
Minato blinked as they popped out of nowhere in his office. "What is this I don't even-"
Obito grinned and scratched the back of his neck. "It's a long, long story sensei."