Reputation: 11269
How can I undo unstaged modifications to a single file? By unstaged, I mean git add
has yet to be performed since the last checkout.
Upvotes: 3
Views: 369
Reputation: 777
Like I already posted in the Comments before,
git checkout <filename>
is what you are looking for.
For more informations, see http://githowto.com/undoing_staged_changes , its a nice git tutorial.
Upvotes: 3
Reputation: 49473
This is the command you're looking for to back out your local unstaged changes
.
WARNING: Any local changes in the file would be lost and the file would be replaced with the one from HEAD
.
git checkout -- filename
Upvotes: 2