Typically you can edit a grid line, dragging an end to a point that should be in alignment with an adjacent grid line. Normally you'll find that Revit will snap and lock that grid line to the adjacent one.
When Revit doesn't behave this way you have a grid line who's origin is at the opposite end than the one you hope to align to. Revit knows which end was first (no bubble) and last (bubble) and uses that relationship to determine how to align/snap.
You can get them to snap/align again by dragging one end of the offending grid line past it's own other end (be sure to unlock the ends first). Then adjust each end so it is aligned with an adjacent grid line(s). Now the "same" ends are near each other and will align.
If you have offset a grid line using the grips and now want it straight, select the grid, right click, choose the "Reset Extents to Default" option
Hope this helps...long winded, yikes!!