Rotate Edge to Be Perpendicular to the Ground
This is how I usually do it...


Go to navigation panel > Mesh Display turn on display edge length.
Select the vertex point you want to rotate the line on ... (but we DO NOT rotate)
Instead, Hit E then Z for the axis you want the point to extrude in and key in the edge length revealed in step 1.
Select the diagonal edge and hit delete


Now you have the new edge perpendicular to the ground.

Hope that helps.