Totally agree, @ishrth_fathima. In my experience working across multiple team branches, safety comes first.
If you’ve already pushed, the better way to git remove file from commit—without rewriting history—is to just remove the file from version control using:
git rm --cached <file>
git commit -m "Remove mistakenly committed file"
This keeps the file on your machine but removes it from Git tracking. It’s especially handy when collaborating in a shared repo since it doesn’t disturb others’ clones or the commit timeline. Clean, safe, and team-friendly.