Written and first recorded (as a demo) by Paul McCartney (1969).
Hit version by Badfinger (US #7/UK #4 1969).
From the wiki: “Paul McCartney recorded a solo demo of his song on 24 July 1969, when he arrived early for an Abbey Road album session. He sang the double-tracked lead vocal and played all the instruments: he sang and played piano on the first take, sang again and played maracas on the first overdub, drums came third and bass guitar was added last. It took less than an hour to finish.
“On 2 August 1969, McCartney presented his demo to Apple band Badfinger (then called The Iveys) telling them, ‘Okay, it’s got to be exactly like this demo.’ His ‘carrot’ for the band was his offer to produce this song and two other Iveys originals for the movie The Magic Christian, since he had a contract to supply three songs for it. The band followed his instructions.
“McCartney’s demo appears on various bootlegs. Although McCartney was the only Beatle performing on the record, it was officially released in 1996 on The Beatles Anthology 3 and issued under the Beatles’ name.”
Badfinger, “Come and Get It” (1969):