That was Vestiges of the Natural History of Creation, first published anonymously in 1844 by the Scottish journalist Robert Chambers. It presented a cosmic theory of evolution that lacked Darwin's key insight (the mechanism of natural selection), posited a biased view of human progress, was roundly criticized by scientists as mistaken about geology and other subjects, and in subsequent editions took pains to say it was perfectly compatible with Christian theology. Still, it did advance the idea to a wide audience that species we see today were not fixed but had descended from other forms, and the controversy it stirred gave Darwin pause.
The following passage comes from the groundbreaking 1889 biography Springfield, Illinois. Herndon writes:
For many years I subscribed for and kept on our office table the Westminster and Edinburgh Review and a number of other English periodicals. Besides them I purchased the works of Spencer, Darwin, and the utterances of other English scientists, all of which I devoured with great relish. I endeavored, but had little success in inducing Lincoln to read them. Occasionally he would snatch one up and peruse it for a little while, but he soon threw it down with the suggestion that it was entirely too heavy for an ordinary mind to digest. A gentleman in Springfield gave him a book called, I believe,"Vestiges of Creation," which interested him so much that he read it through. The volume was published in Edinburgh, and undertook to demonstrate the doctrine of development or evolution. The treatise interested him greatly, and he was deeply impressed with the notion of the so-called "universal law" evolution; he did not extend greatly his researches, but by continued thinking in a single channel seemed to grow into a warm advocate of the new doctrine. Beyond what I have stated he made no further investigation into the realm of philosophy. "There are no accidents," he said one day, "in my philosophy. Every effect must have its cause. The past is the cause of the present, and the present will be the cause of the future. All these are links in the endless chain stretching from the finite to the infinite.
That's the extent of what's known about Lincoln's thoughts on evolution, says Michael Lind, a senior fellow at the New America Foundation and author of the 2004 book What Lincoln Believed. "Herndon's testimony suggests that Lincoln was not only familiar with the idea of evolution," Lind says in an email, "but convinced by it."