Howto make a line completely horizontal/vertical, after placing it?

I have a problem where I edit a line, and then accidentally move it a bit left or right. After placing a line, how do i make it snap completely horizontal/vertical?