I agree with all of the above, but would add that by far the best method is for a hand at the bow to shove off first.
In the case of a boat alongside a ship which is making headway, at low speed, the normal principles of steering apply.
If, however, the speed of the ship is excessive, a problem can arise. When I was in training as a pilot I was aboard a VLCC Shell tanker, outward bound from Tranmere. We had been lying ebb-way, starboard-side-to, at the oil-stage. Leaving on the flood-tide, we let go all aft, letting the tide shove the stern off the stage. At about 90 degrees, we backed off the stage, using a tug pushing on the port side to help the swing. Once we had completed the 180 degree swing, we also had substantial headway, heading down-river, and we could see that the pushing-tug was having difficulty in sheering off. "Stop her", called Pilot John Megginson, as we looked over the port side and our own speed through the water dropped. "Now she'll go", said Meggo:- and sure enough she did, allowing normal steering principles to apply.