Cryptomnesia
Cryptomnesia, or "concealed recollection," is the name for a theoretical phenomenon involving suppressed or 'forgotten' memories. It refers to cases where (apparently) a person believes that he or she is creating or inventing something new, such as a story, poem, artwork, or joke, but is actually recalling a similar or identical work which he or she has previously encountered. According to the theory of cryptomnesia, the person is not engaging in plagiarism, but is rather experiencing a memory as if it were inspiration. Proponents of the cryptomnesia phenomenon believe it is possibly a means of recalling to mind certain experiences that one otherwise would not remember.

# Cryptomnesia in writing
As explained by Carl Jung, in Man and His Symbols,
"An author may be writing steadily to a preconceived plan, working out an argument or developing the line of a story, when he suddenly runs off at a tangent. Perhaps a fresh idea has occurred to him, or a different image, or a whole new sub-plot. If you ask him what prompted the digression, he will not be able to tell you. He may not even have noticed the change, though he has now produced material that is entirely fresh and apparently unknown to him before. Yet it can sometimes be shown convincingly that what he has written bears a striking similarity to the work of another author--a work that he believes he has never seen."
Jung goes on to list more specific examples. Friedrich Nietzsche's book Thus Spoke Zarathustra includes an almost word for word account of an incident also included in a book published about 1835, half a century before Nietzsche wrote. This is neither considered to be purposeful plagiarism nor pure coincidence. Nietzsche's sister confirmed that he had indeed read the original account when he was 11 years old.
Helen Keller seriously compromised her and her teacher's credibility with an incident of cryptomnesia which was misapprehended as plagiarism. The Frost King, which Keller wrote out of buried memories of a fairytale read to her four years previously, left Keller a nervous wreck, and unable to write fiction for the rest of her life.
Cryptomnesia may be the result of some memories becoming forcibly unconscious ones, due to lack of reinforcement through use. There may be enough of the memory left to recall it but not to recall its origin. Therefore it does not always take the shape of plagiarism, as it would in writing, as well as musical compositions, and other art forms, but can also be the basis of philosophy.
"The ability to reach a rich vein of such material  and to translate it effectively into philosophy, literature, music or scientific discovery is one of the hallmarks of what is commonly called genius." ---Carl Jung, Man and His Symbols.
"We can find clear proof of this fact in the history of science itself. For example, the French mathematician Poincare and the chemist Kekule owed important scientific discoveries (as they themselves admit) to sudden pictorial 'revelations' from the unconscious. The so-called 'mystical' experience of the French philosopher Descartes involved a similar sudden revelation in which he saw in a flash the 'order of all sciences.' The British author Robert Louis Stevenson had spent years looking for a story that would fit his 'strong sense of man's double being,' when the plot of Dr. Jekyll and Mr. Hyde was suddenly revealed to him in a dream." ---Carl Jung Man and His Symbols
The mention of Kekule is most interesting. While researching benzene, the German chemist dreamed of a snake with its tail in its mouth. Kekule interpreted the snake as a representation of the closed-carbon ring of benzene, but the symbol of the snake with its tail in its mouth is an ancient one known as the Ouroboros. It can be found in Greek manuscripts from as long ago as the third century BC. This snake can also symbolize reversible chemical reactions.
Robert Louis Stevenson refers to an incident of cryptomnesia that took place during the writing of Treasure Island, and that he discovered to his embarrassment several years afterward:
I am now upon a painful chapter. No doubt the parrot once belonged to Robinson Crusoe. No doubt the skeleton is conveyed from Poe. I think little of these, they are trifles and details; and no man can hope to have a monopoly of skeletons or make a corner in talking birds. The stockade, I am told, is from Masterman Ready. It may be, I care not a jot. These useful writers had fulfilled the poets saying: departing, they had left behind them Footprints on the sands of time, Footprints which perhaps another - and I was the other! It is my debt to Washington Irving that exercises my conscience, and justly so, for I believe plagiarism was rarely carried farther. I chanced to pick up the Tales of a Traveller some years ago with a view to an anthology of prose narrative, and the book flew up and struck me: Billy Bones, his chest, the company in the parlour, the whole inner spirit, and a good deal of the material detail of my first chapters - all were there, all were the property of Washington Irving. But I had no guess of it then as I sat writing by the fireside, in what seemed the spring-tides of a somewhat pedestrian inspiration; nor yet day by day, after lunch, as I read aloud my mornings work to the family. It seemed to me original as sin; it seemed to belong to me like my right eye.

# Validity
Critics of the cryptomnesia explanation point out that there has never been any scientific proof of its validity. Every supposed incident of cryptomnesia may also be explained by deliberate plagiarismthe testimony of those involved cannot be held to be scientifically reliable. For the same reason, though, cryptomnesia as a valid phenomenon cannot be ruled out solely based on testimonial evidence. As a result, the validity of cryptomnesia remains a matter of opinion.  However, the human, unpracticed reactions and the later testimony of the accused "plagiarists", as shown in their initial honest surprise at the information of their "borrowing" and their undisguised embarrassment when they realize the true source of their unconscious "inspiration", tends to provide reasonable evidence that "conscious" copying was not the case.
Nevertheless, precedent in United States copyright law as of 2006 is to treat alleged cryptomnesia no differently from deliberate plagiarism. The seminal case is Bright Tunes Music v. Harrisongs Music, where the publisher of "He's So Fine", written by Ronald Mack, demonstrated to the court that George Harrison borrowed substantial portions of his song "My Sweet Lord" from "He's So Fine". The Court imposed damages despite a claim that the copying was subconscious. The ruling was upheld by the Second Circuit in ABKCO Music v. Harrisongs Music, and the case Three Boys Music v. Michael Bolton , upheld by the Ninth Circuit, affirmed the principle.