Doing anything that would normally get you saved will also get you saved to an extended instance. This includes killing a boss or miniboss, and using an attempt on a heroic boss. As soon as this happens, you can't undo the raid extension for the rest of the week.
You are unable to revert your lock after you do anything that would save you to the instance. Wiping to a heroic mode boss will save you to the instance. I'm not 100% sure of the timing for ICC , but with ToGC, you would become locked as soon as the boss despawned. Theoretically you could have avoided the lock by dropping the raid, but I'm pretty certain at least one of your group would still be saved that way.