The fact that you feel horrible is a good sign- it means that you recognize that what you did wasn't right and you don't want to repeat the behavior.
You can't change the past or undo what's already happened, but you CAN learn from your past mistakes and take precautions to keep it from happening again. It's your responsibility to make sure this never happens again. You were very lucky that nothing bad happened to your baby last night.
If this was a once-in-a while occurrance, then, quite simply, don't do it again! Don't have more than one or two beers in an evening, or don't drink at all.
If you can't control the drinking, or you can't limit yourself to 2 beers once you start, then you need to get help, either through AA or a mental health professional. Until you're clean and sober, don't co-sleep. If you're too drunk to care for the baby properly, then you shouldn't nurse until you're sober- the alcohol level of breastmilk is approxiomately the same as in your bloodstream.