To reproduce the glitch you have to be in Survival gamemode and keep hitting a player that has creative gamemode until your weapon breaks (i've tested it using a golden and wooden sword).
In order to get the weapon back as new you can do the following:
relog/rejoin the server
open your inventory and click on the slot where the weapon was before it broke
You'll notice that the weapon you used to hit the player with has magically reappeared!
video: http://youtu.be/ZiF0U8XSvnE
Edit: When doing the same against survival players who ate a golden apple, the weapon returns instantly, but it will have a durability of 1
Related issues
Comments


Why have our comments been removed and has the status been set to resolved, while the issue hasn't been fixed in the original bug report? (i tested it a few minutes ago after [Mod] Jar_ posted his comment).


@ [Mod] Jar_: done 😉 (also added a video with proof)
Possibly.