I always thought that the inscription on the Lincon memorial was the 'actual' one?Actually he didn't. Obama delivered what is known as the 'Nicholay verision', which is widely thought to be the actual text as drafted by Lincoln and brought with him to the battle site, or certainly the definitive first draft. It differs in a number of respects from the version written down contemporaneously by reporters. It is not clear whether Lincoln adlibbed the bits not in the speech, including the 'under God' phrase, whether the journalists misheard him (there obviously were no microphones. Lincoln also had a rather high pitched voice) or they added in extra bits. The verifiable versions in Lincoln's hand at the time the speech was delivered don't contain the 'under god' words.
Lincoln seems to have reconstructed the speech for later copying from journalist reports and that seems to be where the 'under God' came from. Whether it was a later addition by him, or something he quoted from journalists who had misheard him, is not certain.