Recall that the opposite of a number is that number on the other side of the origin (zero) on the number line , which is at equal distance from zero.
So if we mark the position of -1/7 on the left of zero on the number line, its mirror image on the other side of zero is the opposite. That is the number: 1/7
which looks like the second answer you typed.