Go to flutter main directory e.g C:\flutter
then open the command line and write the following code:
git reset --hard
it works for me