Hello. My name is***** can assist you with your question. If this is a Sentry safe or safe made by Sentry – this includes a large number of consumer safes – you can get the master combination if you are unable to unlock it. But it sounds like you did not lose your original combination. Pressing a or pressing the will have the same effect, so you didn't do anything unusual by pressing B. You should be able to simply enter the pin code again to open it. If not, let me know and I can tell you how to get the master combination in case your pin code has somehow been changed.
All you have to do is go to the following page and fill out the form. Once you fill out the form, it will take a couple of days to get the master combination. Once you do, you will be able to set your personal PIN again.