Suppose I am able to lift a body of mass $m$ up using a constant force $F=mg$ so that net acceleration is zero on it. I want to find the potential energy and the total energy of the body when I have made the body travel a height $h$.
Easy. Gravitational Potential Energy $= mgh$. Kinetic Energy $= 1/2 m v^2$. Add them up and I get total energy.
Now. Seeing this a bit differently. Work done by Force $= mgh$. Work done by Gravity $= - mgh$. Net Work Done $= mgh -mgh = 0$ N. But potential energy $= mgh$.
How is this potential energy achieved when the net work done is zero? This is my doubt. I know I'm missing some basic concept here but please help.