The reference measurement (Vref) is meant to provide a ground truth, the so-called common mode voltage that is sensed by every electrode. There is no one definitively correct location for a reference measurement. Single electrodes as well as averages of electrodes are commonly used as references.
The basic idea is that every electrode by definition measures the common mode voltage plus some additional information, which is the EEG we’re interested in.
So for channel 0 (Vch0), the EEG signal from the TP9 location:
Vtp9 - Vref = Vch0 —> this subtraction is performed by the amplifiers, it’s built into the electronics, so it always happens.
Vtp9 = Vch0 + Vref —> this is by definition, as I said before.
(Vch0 + Vref) - Vref = Vch0
So, if you want to use a different electrode as a reference, you just need to subtract it from all the other electrodes including the old REF one. You can then treat the old REF electrode as a normal EEG channel. For instance, if I want to use TP9 as a reference for whatever reason:
Vch0 = ((Vtp9 + Vref) - Vref) - Vtp9 = 0 (your new reference/baseline)
Vch1 = ((Vfp1 + Vref) - Vref) - Vtp9 = Vfp1 - Vtp9
…and so on for the other locations…
…and for the former reference channel (let’s call it, uh, Vnew):
Vnew = Vref - Vtp9