In a gravitational field, the gravitational force acting on a body (of mass m) at a point x metres away from the attracting body (of mass M) is $\frac{GMm}{x^2}$. Integrating this force from a point at infinity to x gives $-\frac{GMm}{x}$, or the work done by the gravitational field on the mass in moving the mass from a point at infinity to x. Then, the gravitational potential at point x is $-\frac{GM}{x}$.
However, the definition that my school gives is : "Gravitational potential at a point in a gravitational field is the amount of work done by an external agent in moving one unit of mass from a point at infinity to the point in the gravitational field, without any acceleration". The lecturers explained that as a body moves closer to the attracting body, it accelerates and gains kinetic energy. In order to maintain a constant velocity, negative work must be done by an external agent to remove this extra kinetic energy.
Now I am very confused, because both seem valid to me. What does "gravitational potential" actually mean?