just scrap it
One problem with most of us developers is that we get too attached to our code. Whenever someone changes it in any way or criticizes it any way someone gets upset.
I used to be like this because like most of us, I thought my design was always the best design. As developers we need to lose our egos and be able to accept criticism. I don't care if I spent 1 hour, 1 day or 1 month on a piece of code; if someone refactors it, removing pretty much all the work I did, then that's fine. I look at situations like those as learning opportunities because I obviously didn't write the simplest thing that could possibly work. The other person can even be you. Go ahead and reflect on those 5 classes you wrote the other day, you knew they were wrong when you were writing them but hey, you had to get it done by friday. Don't be afraid to get in there and scrap 'em. I do this all the time and its never as much work as you think its going to be.
Code reviews are another favorite of most developers, that is for the reviewers. There's nothing more fun than you and a bunch of your fellow developers grilling some new hire about how terrible their code is. But when you're the reviewee don't take their advice personally. Remember it, write it down and then go try it out; you never know, you might actually be wrong.
The same thing can happen with your users. We all know the situation, the user says they want 'X', you implement 'X' and then they tell you its all wrong. Don't get frustrated. I know its easy to, especially if 'X' took you a lot of time and effort to develop. Just scrap 'X' and start over, who cares? No big deal. This is an opportunity to reflect on what you wrote and to discover the good and the bad. The beauty of software is that you can always start over. The only thing it costs you is time. And this just means more money to charge the client.