By breaking block A and quickly placing block B (which can have different orientations), will cause block B to orientate in the way it would have if it were placed against block A, but in blocks B position.
So far I've tested it with all wooden types, end rods and trapdoors and it works on all of them.
Duplicates MC-159145 (has more details, votes and watchers)