If you couldn't do it, the least you could do is tell him
earlier that you can't do it due to your attachment but you will do
another part of the project 
I hate to say this but it is very irresponsible of you to wait till
the last minute before dropping the bomb.
Anyway, I think you should just tell him honestly about it and what
you intend to do to make-up