George Harrison wrote Not Guilty just after returning from the Beatles' 1968 trip to India to study transcendental meditation with the Maharishi Mahesh Yogi.
In May, Harrison recorded a demo of the song at his home studio. In August of 1968 the whole group rehearsed and recorded numerous takes of the song over three days during the sessions for The Beatles album (also known as The White Album).
The musicians encountered serious difficulties, some of which related to strained interpersonal relations and others related to the music itself, which was tricky in timing and complex in tonal qualities.
The lyrics hint at Harrison's perception of a McCartney-Lennon ego struggle, and his own marginalization.
In any events, the song was ultimately shelved. Critics have said that Not Guilty was perhaps the best of the Beatles recordings that were never released, and that it surely deserved to be on The White Album more than several of the tracks that were included.
In the August recording sessions, the best take of the third day was number 99. After a reduction mix (to free up space), this attempt became "take 102." A number of overdubs were added to it.
More than 12 years after the recording session, audio engineer Geoff Emerick took this enhanced, nearly complete version, made a stereo remix, and reduced the run time by almost a whole minute.
Twelve more years elapsed before Apple Records was able to release Emerick's remix on Anthology 3 (in 1996). Meanwhile, Harrison recorded a different version of his song for his 1979 album, George Harrison. Unlike the approach used by The Beatles which featured distorted electric guitars and an electronically-enhanced harpsichord, the Harrison solo release is mellow and boasts many trappings of late 70s musical styles.
Harrison recorded an acoustic demo in May of 1968 at his Esher home. Though it's never been officially released, it is available on bootlegs.
A loungy, 70sish version was released on George Harrison's 1979 self titled album.