The JST connectors have a small silver tab on them. You can use a small screwdriver or dental pick as shown to depress the tab on the pin and the pins can be slide out. Once out you can put the black in the red side and the red on the black side.
Push down on tab while pulling wire from the connector.
Shows the tab inserted and the tab outside the connector. If you need to you can bend the tab away from the wire if it doesn't stay re-inserted after removing it. The tab locks the wire in place.