Roughly speaking, the value returned by TH1::GetEntries is how many times you called TH1::Fill and/or TH1::SetBinContent so, it can only “increase”. You can use TH1::SetEntries, if you want to modify it.
You can call TH1::ResetStats if you want to “reset” histogram’s statistics (including the “number of entries”) and replace it with values calculates from the actual bins’ content. Unfortunately, how everything gets recalculated (including the “number of entries”) depends also on the actual TH1::Sumw2 setting (i.e. whether the histogram has / hasn’t associated error bars).
Note: In principle, TH1::GetEffectiveEntries and TH1::Integral do not depend on TH1::GetEntries.