Hi,
In practice, you can normally use a single high value resistor (perhaps 100k ohms+) to most PICaxe pins. This is because most pins have a "catching" diode from the pin to the supply rail (Vdd), to prevent the input voltage rising much higher (e.g. to protect against static electricity). There is much debate if this is a "safe" method (IMHO it is), so you could add an external diode ("pointing" away) from the pin to Vdd, to avoid arguments. A cheap diode (e.g. 1N4148) should be fine, but a "Schottky" type (which has a lower forward voltage drop) would ensure that the internal diode never conducts any current.
However, the "Input Only" pin on most PICaxes (Leg 4 with most M2s) does NOT have an internal diode (because the manufacturer can intentionally take it to a higher voltage to program the chip), so you MUST put the external diode on that pin.
Finally, beware that if the 12 volt rail is still present when you (try to) disconnect the PICaxe's Vdd supply, then current may flow through the catching diode and keep the chip powered (but not necessarily running properly). This can occur whether or not you use an external diode and even if you use a potential divider as suggested by Westy.
Cheers, Alan.