Zhi Wang
Zhi Wang

Reputation: 1168

Git: How to undo unstaged changes in a certain folder

I made many changes which were not staged, and I want to undo changes in a certain folder, how can I achieve this?

I knew that use git stash will undo all changes, so how can I achieve my above goal?

Upvotes: 2

Views: 97

Answers (1)

EricSchaefer
EricSchaefer

Reputation: 26330

a certain file: git checkout -- filename
a certain path: git checkout -- path
all changes: git checkout -- .

Upvotes: 2

Related Questions