我克隆了一个git仓库,并在其主分支中进行了一些更改。过了一段时间,我想忽略我刚刚做的更改(而不将它们提交),并切换到另一个分支。但是,由于有未提交的更改,它阻止了我进行切换。我如何在不使用stash的情况下忽略这些更改?具体情况如下:
$ git checkout gh-pages
error: Your local changes to the following files would be overwritten by checkout:
somefile.txt
Please, commit your changes or stash them before you can switch branches.
Aborting