It depends if the swapped mind considered themselves me or not (clone's brain?). If not then perceived identity would follow the mind, even if the legal identity didn't.
If it were a clone's mind, we would have to come to some sort of understanding on the subject.
It can quickly get convoluted. E.g. if I became a digital identity, would I be willing to split off versions of myself for particular tasks, only to absorb them later. Conversely, could I function as such an entity? How long would I need to diverge before I became a truly separate entity in my own mind?
The book "Accelerando", by Charles Stross plays with this. He refers to them as eigen-minds. A collection of minds overlapping within a single identity. How liable is a diverged eigen-mind from its alternates, when it comes to contracts and debts?