Do the unexpected-be confident, friendly and ready to joke Apologize. Try to understand what the other person wants, thinks or feels. Give the other person an out. Don't back them into a corner. Think about what you're going to accomplish by fighting and what would happen if you just walk away.
Chances are the negatives of fighting outweigh the positives.
Ask for help. Enlist the aid of a teacher, parent or other adult. If you've fallen into a violent crowd, opt out. Find other buds to hang with. Kessler Institute for Rehabilitation, West Orange, NJ SEX, etc.