Go to a blacksmith and click right above your inventory to switch to the repair screen or by weapon/armour repair kits if you need to repair in the field. Whenever I upgrade a sword I always keep my last one as a spare in case my main one gets damaged and I don't have any repair kits.