Heat pump wiring is NOT the area for a DIY; unless he makes a living as an HVAC expert. The question and answers are SO FAR beyond what it takes to understand that it is pitifully laughable. There are three major conceptual mistakes in the posts:
1. Wire color has NO fixed meaning in relation to the terminals. They are picked by random convention among installers. There is NO universal wiring scheme EVERYONE uses. This means that the terminals of the machine are the important points to know and the wire just goes between them to perfoem a function.
2. DIY's WANT wiring to be simple so they IMAGINE that wiring is universal and ALL installers use the SAME colors and the manucacturers ALL use the same wiring types and diagrams - NOT SO. Once the wires are taken off without labelling them; there is NO WAY to get back what was unless the repairperson knows what each terminal is for on the indoor, outdoor units and thermostat.
3. There is NO positive 24 volt terminal on an alternating current transformer. A DIRECT CURRENT device has a 24+ terminal; not an alternating current transformer.
I could go on; but the situation is pitiful. GET A PRO. Don't ask unlicensed, inexperienced guessers to give you vocational courses for the most complicated residential wiring job.