Reversal of magnetization in NdFeB magnets