Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git reset single file in feature branch to be the same as in master [duplicate]

Tags:

git

I'm trying to revert my changes in a single file in my feature branch and I want this file to be the same as in master.

I tried:

git checkout -- filename git checkout filename  git checkout HEAD -- filename 

It seems that none of these made any changes to my feature branch. Any suggestions?

like image 538
Anton Belev Avatar asked Jun 22 '16 15:06

Anton Belev


1 Answers

If you want to revert the file to its state in master:

git checkout origin/master [filename]

like image 150
Dennan Hogue Avatar answered Nov 06 '22 12:11

Dennan Hogue