This invention relates to a cationically and amphiphilically modified polygalactomannan having repeating units with an average D-mannosyl to D-galactosyl residue ratio of at least 5 to 1 and to compositions containing same. A portion of the hydrogen atoms of hydroxyl groups situated on the mannosyl and galactosyl residues of the galactomannan are replaced with an amphiphilic and a cationic substituent.