Always trust that you know who you are. When you understand your mistake, just apologize, the people who matter will remember who you are. Those people will forgive you.
Sometimes we do things that go against the energy that we hope to put in this universe. We are all human. It doesn't mean that our values or goals have changed. After learning the truth, people's true colors are shown. The people who we should worry about losing are those that are able to remind us who we are, even when we can't remember ourselves. Don't push those people away.