There are 2 types of NNID unlinks:
A "soft" unlink -- done using either the NNID removal script or by deleting the NNID info files -- unlinks your NNID w/o formatting, and lets you link or register a new NNID. But, in the Nintendo databases, the unlinking won't delete the fact that it is linked to your console, and that NNID won't be able to be linked to any other console than the one you just unlinked it from.
And a "hard" unlink -- done using a system format and/or transfer -- will not only let you link a new one, but will also connect to id.nintendo.net and let Nintendo know that the NNID isn't currently linked to any console, so you can go and link the unlinked NNID to any 3DS.
A format shuffles your console's encryption key. Good luck recovering from the brick that you'll get from restoring your old, encrypted NAND backup.