In United States patent law, "swearing back of a reference" is a process where an inventor, in certain circumstances, can get a US patent even though the invention became public before the inventor filed an original patent application. This law has been substantially changed as of March 16, 2013.
Swear back of a reference Wikipedia
There is a common misconception that if an inventor can prove they are the original inventor of an invention, they deserve a patent. This is not necessarily true.
National governments grant patents to promote the welfare of their respective nations. The rationale behind this is that general welfare of a nation is improved if inventions that would otherwise be kept secret are made public. Patents encourage public disclosure by granting limited monopoly rights to inventors for the new and non-obvious aspects of their inventions that they describe in their patent applications.
Accordingly, if an invention has already been disclosed to the public before a patent application is filed, there is no need for a government incentive to disclose the invention. Whether or not an inventor can "prove" they made the original invention before someone else made it public is irrelevant. Almost every country in the world bars an inventor from getting a patent once the invention is public.
A critical exception is the United States. The United States grants a one-year grace period from when an invention first becomes public to when an inventor has to file their patent application. If, in the course of patent application examination, a patent examiner cites a reference that predates the filing date of the patent application by less than a year, an inventor may still get a US patent if they can swear back of the publication date of the reference.
To effectively swear back of a reference, an inventor submits a declaration to the US patent office, with written evidence that shows they fully conceived of the invention before the effective date of the reference. They must also show they were diligent in either reducing the invention to practice or in filing a patent application.
Documentary evidence must support all factual assertions in the swear back. A copy of a notebook page that describes the invention, signed by the inventor, dated, and preferably witnessed by a third party can serve as written evidence. A written declaration by a witness that attests to when the invention was conceived can also be adequate. Similar evidence may be used to support the assertion of diligence.
It can be very difficult to demonstrate diligence. The inventor, for example, must work continuously on the invention. If the inventor works on another invention before the first one is reduced to practice, that destroys the continuity and the inventor is deemed to not have been sufficiently diligent to be entitled to a patent. Many other restrictions apply as well.