It is said that in every field there’s that person who was years ahead of their time. For instance, Paul Morphy (born 1837) is said to have retired from chess because he found no one to match his technique that very much resembled modern chess theory.
So, who was the Paul Morphy of mathematics?
I think Asaf makes a good argument against people like Galois and Cantor. As he says, if Cantor didn't develop set theory, who would have? I think to find someone who is arguably ahead of their time, you need to find a mathematician whose work was ignored, and then reinvented in substantially similar fashion by others much later, so that you can say “look, this guy had it, but it was too soon, and then later someone else got credit for inventing the same thing.” And so I nominate the logician Charles Sanders Peirce (1839–1914). When you study the early history of logic, it sometimes seems that every other sentence is “This work was anticipated by C.S. Peirce, whose contribution was unfortunately overlooked.”
To give a very narrow and incomplete idea of Peirce's accomplishments in mathematical logic I will quote briefly from the Stanford Encyclopedia of Philosophy:
(Burch, Robert, "Charles Sanders Peirce", The Stanford Encyclopedia of Philosophy (Summer 2013 Edition), Edward N. Zalta (ed.))