Various ways to remove local Git changes

前端 未结 9 936
难免孤独
难免孤独 2020-11-27 08:45

I just cloned a git repository and checked out a branch. I worked on it, and then decided to remove all my local changes, as I wanted the original copy.

In short, I

9条回答
  •  时光取名叫无心
    2020-11-27 09:31

    For discard all i like to stash and drop that stash, it's the fastest way to discard all, especially if you work between multiple repos.

    This will stash all changes in {0} key and instantly drop it from {0}

    git stash && git stash drop

提交回复
热议问题