user2131316
user2131316

Reputation: 3287

Drop updates of a file in git

I have made some updates in one file, but I do not need those updates any more before I stage and commit, how could I drop the updates in this file and get the version before updates?

Upvotes: 0

Views: 37

Answers (1)

Viktor Vojnovski
Viktor Vojnovski

Reputation: 1371

Have a look at http://git-scm.com/book/en/Git-Basics-Undoing-Things:

Use git checkout -- <file>... to discard changes in working directory.

Upvotes: 1

Related Questions