How to rotate/line up an object to an axis
1. If you rotated your object in Object Mode :
Hit Alt+R to reset rotation
2. If you rotated your object in Edit Mode :
That was a bad idea, cause you can't do .1.
Generally, if you want to rotate/scale your whole object, do it in Object mode.
If you want to rotate/scale a part of your object (some verts/faces), do it in Edit mode.
Ok but it's done now. What can I do ?
You can try box-selecting the vertices that you know should be aligned, and align them manually (s/z/num0 to align them on Z). It's tedious, that's why you should always prefer .1.