Reversible diamine cross-linking of polyimide membranes