It already happened. I am sure you feel bad. But after some time, you will feel better.
Life is hard. And sometimes there is not much you can do about it. So try to think positive.
Think about what you have learned from the process. The time and efforts you put into it is tuition for what you have learned.