Bad auth: failed authentication node-js

Hi, I’m new to developing and I’ve run into a little problem I can’t solve. I keep getting failed authentication error after deleting my .env file (which housed my database credentials) from my git history. I have changed the password in my connection string accordingly everywhere I could think of but the same error keeps coming up.
My app was working fine before I deleted the .env file. I did place the .env in my gitignore file, could erasing it from history also erase it from my gitignore file? I can provide my repo if that’s allowed. Please help.