I think I also fell into this trap (rookie error) -
Since you asked for ideas -
Rather than stopping making edits (or in addition to), perhaps a more visual way of showing what target you are working on?
Maybe a colour change in the UI? I do this with WordPress development and change the status bar colour for development, staging and live versions.