At the end of a bar magnet, H points in the opposite direction to M and B. This is due to the boundary condition on H at the end of a magnet. In many books, this is called a
"demagnetizing field". That is a misnomer, because it is B and not H that acts to polarize the atoms in the iron. Since B near the end of the magnet is 1/2 its value at the middle, there is some tendency for the magnet to lose a bit of its magnetization (M) over time.