I had the same problem and I have resolved it by going through the following steps.
If you need to keep your changes -
- First you need to run
git checkout master
command to put you back to the master branch. - If you need to keep your changes just run
git checkout -b changes
andgit checkout -B master changes
If you don't need your changes
To removes all untracked files from your branch run
git clean -df
.Then you need to clear all unstaged changes within your repository. In order to do that you have to run
git checkout --
Finally you have to put your branch back to the master branch by using
git checkout master
command.