Accidentally leaked the solution to an assignment, what to do now? (I'm the prof)
Very simple actually. Abandon the assignment. Apologize for the error, but not for wasting people's time. Those who didn't find the solution and worked on it certainly learned something. Those who found the solution used their time otherwise and hopefully learned something else. 

Mistakes happen. 

If you use a large number of exercises in grading it is probably harmless to give everyone full marks. They will be happy and it won't really matter otherwise. But trying, in any way, to discriminate between various levels of "performance" on such an exercise is a minefield. 

One thing to remember, however. Presumably you gave that assignment because students would be expected to learn some specific thing(s) by doing it. That may not have occurred, so you need to assure that you find some way to reinforce that lesson in some future activity.