As a disclaimer, I don't have any first hand experience with self harming, but have witnessed it with friends of mine in the past. First, I'd suggest trying to find someone who is reliable and understanding, whether it be here or someone you're close to, that you can talk to when you may have the urge to self harm. I know in the past with them, just talking it out and getting their mind off the desire to self harm was helpful. Aside from that, making a promise to do something specific that you've predetermined when you're thinking about self harming might be helpful. This could be a number of things such as writing in a journal about why you're wanting to self harm. This will keep your hands busy and getting the thoughts out of your head onto paper can be therapeutic.
These may all be stupid ideas that don't help you in the least, but aside from that, know that I'm sorry you're feeling down and I hope you can find a way to overcome the urge to self harm. :) I'm always happy to chat anytime I'm around as well!
Edit: Without making an entire new post, I'd like to second Rexual's statements, exercise is an amazing stress reliever all of the time whether in a state of desperation or you just want to let off some steam before things get too bad!