During the holocaust, the Nazis were deciding who was going to be killed the next day and who was going to live. A doctor went from child to child while they were sleeping and removed the kippa of every child who was judged for death. Reuven got up in the middle of the night and went to relieve himself. When he realized that his kippah was missing he borrowed the kippah of Shimon who was sleeping. He was so tired, that before he returned the kippah, he fell asleep.
Because of this Reuven's life was spared and Shimon was killed. Hashem yinkom damo!
Now Reuven wants to know if he must do teshuva for being the indirect cause of the death of his friend.
The Noda Bi-yehuda [או"ח סי' לד] writes that if someone sent his fellow to a place to do business on his behalf and he was killed, the sender needs kappara because he was the cause of his friend's death. Maybe we can say that here too since Reuven had a hand in his friend's death he needs a kappara.
However, we can say that here is different because Reuven was doing a mitzva [as the Shulchan Aruch writes that it is forbidden to walk 4 amos without a kippah] and since he was completely justified he needs no kappara. The mishna brura in fact writes [סי' א סק"ב] that it is permitted to borrow netilas yadaim water if he knows that he will immediately replace it.
יה"ר שנזכה לתחיית המתים בקרוב ויאבדו כל איובי השם
עפ"י חשוקי חמד עמ' רה