I have a fork in my github account and I cloned the fork to my local computer. Now I have made some commits, and pushed it to origin
. Then, I updated the readme.md
file in the fork directly in GitHub, not in the local clone. I made a commit called Updated readme.md file
.
Now I wanted to sync it with my local computer. So I ran git pull
.
This gave me the error:
Cannot pull with rebase: You have unstaged changes.
Please commit or stash them.
After the last commit I have modified 2 files on my local computer. But I no longer want the changes. So, I wanted to remove any changes made to these 2 files and to get in sync with origin
.
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: scripts/filename.js
Untracked files:
(use "git add <file>..." to include in what will be committed)
scripts/anotherfile.js
no changes added to commit (use "git add" and/or "git commit -a")