git checkout
https://git-scm.com/docs/git-checkout#git-checkout---force
You can pass the -f
(force) flag to forcefully checkout the branch, this will wipe out any changes you've made that haven't been committed.
git checkout -f branch
If you don't want to lose all your changes, you can checkout the file specifically with:
git checkout -- src/main/webapp/data/GuerrillaLabels.json
git stash
https://git-scm.com/book/en/v1/Git-Tools-Stashing
You could also stash the changes that you've made and reapply them later on with
git stash
You can view your stashes with
git stash list
And you can apply those stashes by using pop
. Passing nothing to pop
would apply the last stashed item.
git stash pop
Note: this approach can cause conflicts with code.