An Anvil of Krong cursed my weapon. Is there anything to do to undo this, or should I just get rid of this item?
As far as I know, it is not possible to undo either the negative or the positive effects of an Anvil of Krong's enchantment.
As explained by DredmorWiki you have a 5/7 chance of gaining a positive enchantment, and a 2/7 chance of gaining a negative enchantment (except the first use that is always positive)
Cursed weapons can be sold to Brax or thrown into Lutefisk Cube.
I suggest you to always enchant something that you can replace with another, similar item in your inventory, in case Krong is angry with you.
From this discussion board: