Hang in there and don't let it get you down! Happens a lot. A LOT.
Just be sure to stay in touch with your advisor about what courses to take when. Some courses run every quarter and also in summer. Others only run once a year. Obviously you need to focus on getting those in when they run and not to miss prerequisites when they are offered. If there's a hole in your schedule in the near term because of courses you can't take now due to a missing prereq, you can fill in your schedule with other classes pulled from future quarters in your track. (Like humanities and social science electives, say.)
Again, you're not alone. Falling off track happens far more often than you probably suspect. Just stay in touch with your advisor to minimize the impact. Everything will work out okay.