Next time, wait for a second or two before proceeding. Rushing into an intersection after the light turns green is the same as assuming that it is clear to go. If Im in the front of the line waiting for the light, If possible, I will wait until ALL traffic (to the left and right)has come to a stop before proceeding - this usually only takes a second or two and is a defensive way of riding.
Learn from your close call and move on. I bet you will never make the same mistake again.