Probably what happened is that you tightened the cog against the lockring. Usually if you turn the cog the opposite direction with your chainwhip, you'll take enough force off the threads on the lockring to remove it. Caveat: you could possibly strip your hub doing this.
The same mechanical principle applies with the cones in your loose-ball hub, but you're not torquing on the cone, usually.