It's likely you have source /opt/ros/melodic/setup.bash at the end of your .bashrc (which is added at the end of the Environment Setup section of the ROS 1 installation instructions).
With just a single ROS version installed, that will be convenient (as it prevents you from having to type source /opt/ros/melodic/setup.bash in every new terminal).
I would recommend to remove the auto-source-ing from your .bashrc, and manually source the setup file of the ROS version you want to work with instead.