What make and model is the chain? Shimano, SRAM and most other 8, 9 or 10-speed chains should not have a rivet reinstalled even if it wasn't pushed all the way out. It will make a weak spot and a highly likely failure location.
If it's a Shimano chain, you can get a special replacement pin in the right width at any bike shop. If it's a SRAM, get another Powerlink.