The great difficulty in trying to answer the question is our not knowing what is being reacted. For example, if you have an amide, it could become converted to a nitrile. I'd suggest simply hydrolyzing it back to the amide. However, if it is N-substituted, then you will get an imidoyl chloride. None the less, this should also be hydrolyzeable back to an amide, though with greater risk of cleavage. Can you tell us the real reaction or what you are trying to make?