Inversions are starting to revert.

When Mylan moved its corporate address to the Netherlands in 2015, the pharmaceutical company joined a wave of corporate inversion deals aided by tax advantages of a non-U.S. address. Now, Mylan’s address is coming back to the U.S. through a merger deal this week with part of Pfizer Inc., a sign that the 2017 tax law is rendering these moves less attractive than they once were.

The...