How to fix and restore the ignored content in the .gitignore file
If you have this problem, do not worry about it because it's a very common problem when you work with git branches.
First commit any outstanding code changes.
1.- Remove everything from the index:
git rm -r --cached .
2.- Update all the content added into the git index:
git add .
3.- Finally commit your .gitignore file updated:
git commit -m ".gitignore file fixed!"