Here in NL we have a type of mast that can be dropped under sail and re-set right after crossing under a bridge. This is a pretty exciting operation best practiced a large number of times without the presence of a bridge before you try it for real. Failures tend to be fairly spectacular.
Here a demo on a very small boat, I've seen this done with a big Tjalk and that was most impressive (but I can't find any video of that):
https://www.youtube.com/watch?v=qTwGCPgCsII
With a big ship it will look like an accident is about to happen until the last moment when the sail drops, the mast gets dropped backwards and they are barely out from under the bridge on the far side or the whole operation happens in reverse resulting in very little lost speed.