You can dismantle a gun in the weaponcrafting arsenal screen by selecting a weapon in the list and clicking the Dismantle icon on the lower left of the screen: DismantleIcon

Dismantling a gun has the following effects:

After a gun has been dismantled, it cen be destroyed by clicking the Destroy icon. This will clear it from the arsenal, and you will lose any spent upgrade points as well.