When you go through the portal, piece by piece your atoms get stored and you are scanned with a laser that sees every single atom of your body and then you are converted into an read-only executable that can execute on its own, so when your exe (or some other troll) try to delete your exe file, your atoms are moved back in place, the same way they were when you "entered" the computer. BUT: You forget the whole experience in the computer, because your brain's atoms are in the same place they were when you went through.
WAIT WHAT??? I didn't add that tag!