Smart Copy and Paste?

I have an Xcode project with an iOS App and a tvOS App in it.

I needed to copy some code over from the iOS App to the tvOS App but I accidentally copied too much! I then deleted the part that I copied too much, and in the iOS App code, It was completely GONE!

How can I disable this and is this a macOS feature?