Cuba and Panama have said they will restore consular relations , months after Havana broke ties with Panama City for pardoning four men convicted in connection with an assassination attempt against Cuban President Fidel Castro .