He got cold feet and isn't ready to be someone elses baby dad. Sucks, but on the other hand, its asking a lot of a guy to take on this responsibility. He has every right to refuse, even if the way he did it was awful.
There is more to this story btw. Did you pressure him to move in? Or did something else happen you aren't telling us about? Sane people don't change their mind on a dime and I assume he's sane if you stayed with him this long.
Second thoughts can generally be amended with judicious action; injudicious actions can seldom be recovered with second thoughts.
--Cyteen by C.J.Cherryh