Normally when things go bad the computer should have not reacted at all other than the usb disconnecting in the software. There is some safety between the two, I hope nothing went wrong with it?
So make sure power and usb are removed before you ever plug or unplug anything on the ramps shield. We all learn the hard way.
What I imagine happened (because end stops can be hot plugged) is there is a power, ground, and signal pin on the end stop rail. You must have hit the power pin by mistake and fed power into the board.
If you find the bad component and think you can replace it I have some bad boards here I could send you for parts. Try taking off the shield and just testing the Arduino, to see what half is effected.