OK.
Almost certainly, you hooked the battery up backwards the second time. It's easy to do, and many of use (me too!) have done it.
This fries some important parts and can melt wire insulation inside the sheath, causing wires that should NOT touch to do so because their insulation is melted.
This is not the end of your bike. If you disconnect the rectifier - I think it's the bottom metal thing in your first picture, just pull the plug - you should be able to hook the battery back up ("-" to the big black wire to ground, "+" to the big red wire to the solenoid) and the bike should pretty much work normally (but never charge the battery without a new rectifier). Connect the ground first. If you see a big spark and maybe some smoke from somewhere when you touch the red wire to the battery terminal, stop and find what's happened - probably the melted insulation problem. The starter may also not work without the clutch pulled in, another inexpensive fried part, but there isn't anything else on a stock bike that should be damaged. If it has an aftermarket electronic ignition though, that's probably junk as well.