Cryptomnesia occurs when a forgotten memory returns without its being recognized as such by the subject, who believes it is something new and original. It is a memory bias whereby a person may falsely recall generating a thought, an idea, a tune, or a joke, not deliberately engaging in plagiarism but rather experiencing a memory as if it were a new inspiration. source: Wikipedia https://en.wikipedia.org/wiki/Cryptomnesia you have been warned!
Yeah, it sucks. I once had this cool synth melody which I gotten during shower. Hours and days after working on writing music along this melody line, I found out it was a recalled from Laura Branigan's Gloria synthline