Welcome to Android Central! Do you know if those contacts were saved to your Google account, your Samsung account, or to the local Phone account?
Go to contacts.google.com, in your computer browser, click on the menu button at the upper left, then click Undo Changes. See if that restores your contacts.