Why worry about what is on master, if you save your build artifacts. so that if you need to go back to a the previous behavior, just redeploy the previous productuon build output
That is why you care what is on master: because you need to rebuild if your runtime changes.
If you need to rebuild a specific version, it's as easy as checking out the tag.