I've seen episodes where they adjusted the "matter stream" for things like a discharging weapon.... so they could dissemble you, then change stuff before putting you back together. Hhhhmmmm.....
Yeah, there are huge plot holes in the "theory" behind the transporter that they ignore in the stories.
Essentially they "scan" you when you step into the transporter and "encode" 100% of "you".
Once that data is obtained, it can be "applied" to any sufficient amount of energy/mass to make a new "you".
It was my understanding that the process would convert your mass to energy, to form the raw material to materialize someone when they beamed back in.
Ignore for a moment how that works on the planet surface.
You don't want to send the actual matter/energy to recreate your body, because that will take a lot longer and require substantially more energy than sending just the data.
Ignoring the ridiculous amount of data required to "encode" someone for a moment, there is nothing inherently wrong with that idea.
If we assume for a moment, that 100% of "you" exists as part of your body, then the atoms and energy field that makes up your body is theoretically capable of being "scanned".
Once one has that pattern, then theoretically one could "write" that pattern onto a different set of energy/matter and create a 100% accurate copy of "you".
Recall that through Special Relativity's e=mc^2, matter is nothing but "frozen energy".
So after scanning "you" and making a copy of "you" both are still "you".
Of course, if both bodies were left alive, they would immediately diverge as they had different experiences.
So from a metaphysical standpoint, assuming the process actually works as described, yes, it is still "you", since there would be
no difference between the "you" who was standing on the transporter platform and the "you" who was reassembled elsewhere.
Now back to the plot hole.
If the transporter can work like that, and you can "edit" what's reassembled, then you could use it to cure a whole host o diseases.
Cancer?
Simple don't reassemble the tumor.
Oh and if you can "permanently" store the ridiculous amount of data required to encode a person?
It would be like a video game with a single save file you could overwrite. Save early, save often and if you die, simply have the transporter make a new "you" to continue playing the game of life.