In hydrogen peroxide, each hydrogen still has an oxidation number of +1 because each hydrogen "gives up" a single electron to oxygen. Oxygen, however, now has an oxidation number of -1 because each oxygen gains just one electron from its neighboring hydrogen. The electrons between the two identical oxygen atoms are shared equally, so there is no partial charge resulting from that bond.