if you want to remove the ball you will need to get a hard tapered shaft that is the right size and try to put it in the hole and 'un-swedge' the edge of the hole so you can get the ball and spring out.
to re-swedge you will need a punch slightly bigger than the hole
bob
Not bad advice but where are you going to find that unless you make it. Here is what Elroy did. Getting the ball out is a lot easier than re-staking the new one. Elroy took a die grinder and cut a groove in the ball with a small stone. After that the ball falls out. Then take a small round file and work the stake out so the new ball just goes in.
Don't forget the new spring. Elroy then made a "staking tool" from a 1/4" ID drill bushing (nice and hard tool steel). The dent Elroy was repairing was on a 1/2" Drive tool that had a 1/4" ball. A 1/4" drive tool will require a smaller "drill bushing" to make the staking tool. Let the ball size call out the bushing.
Then grind a bevel on both the OD and ID on the bushing. The ID bevel being rather small. Then get a rod that is the appropriate size. Put the pin through the bushing and use it to depress the spring behind the detent ball. This aligns the staking tool over the ball. Cut the pin off so it is flush with the top of the drill bushing when the detent is depressed.
Line it all up with out disturbing the drill bushing location and strike the "tool" to stake the ball. It takes about 3 hands but it worked for Elroy.
Note, Before you strike the tool, the pin will be proud. The hammer will drive the pin and force the ball down below the staking surface before the stake is formed.
There are other ways but that is how Elroy repaired his. Good luck to ya.