tell him how you feel. especially, tell him that this behaviour is not fair to you and that you aren't just something he can go back to when he feels like it. make it clear that unless something changes, you won't continue talking to him.
if he does decide he will try to be better, HOLD HIM TO IT. if the situation ends up like this again, run a mile. people like this can change, but not all choose to, and if he sees you as unimportant it will be possible for him to treat you this way again. you deserve better than this.
also make sure to take care of yourself, and focus on your life outside of him. situations like this aren't good for anyone and will only seem worse if you make him the centre of your life. he isn't the be all and all.
good luck!