If the path you wish to make vertical is part of a larger path, you can align anchors. This only works if all anchors on path are not selected.
- Use the Direct Selection Tool (white arrow)
- Select the top anchor and the bottom anchor
- Click the vertical align options in the Align Panel
Anchors can be aligned if they are individually selected.
If you aren't concerned with maintaining any specific anchor position, you can use average
- Select the path
Object > Path > Average
Vertical and hit
This averages the two anchors, aligning them vertically essentially in the middle of where the two anchors started. Sort of the same as "align on center".
If your path consists of only two anchors, and you want to maintain the existing position of one of the anchors.... see @Lucian's rotate method.