My understanding from this (https://www.toppr.com/ask/content/concept/gold-leaf-electroscope-209365/) source is that -
To identify the nature of charge: The electroscope is charged by a known body (say positively charged body) and then the body is removed. Next, the body under test is brought in contact with the metal cap. If the leaves diverge further, the body has the same charge(positive) and if the leaves come closer to each other, the body has the opposite charge(negative).
Question -
Suppose, we had initially charged the gold leaf electroscope by touching a rod of +10C to the metal knob. Since both leaves are of the same size, they will get equal charge viz. +5C & +5C. Now let's take a charged rod of unknown nature (Say it is negatively charged, -20C). Again, -20C will distribute into the leaves as -10C & -10C. Now the net charge on both the leaves will be (+5C -10C = -5C).
Therefore, as the magnitude of charge remains the same as before i.e., 5C the angle of deflection between the leaves should also be the same.
(Assumption - Since all the charges on a body get accumulated at the sharpest point, I’ve assumed that when the rod is touched to the electroscope, all the -20C transfers to the electroscope and distributes between the identical gold leaves.)
So, how do we know that the test rod was negative if the deflection remains unchanged even after touching it?