0

i want to reset 1 file in my feature branch i did what is suggested from here :
Git reset single file in feature branch to be the same as in master

but when i do git status i still see that is the file is modified in my feature branch and when i do pull request i still see merage in this file . try to do :

git reset HEAD include/tools.h

and then

git push 

but still is in modified state

$ git status

On branch feature/myfix
Your branch is up to date with 'origin/feature/myfix'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   include/tools.h

how should i reset this file , i want the master version

user63898
  • 29,839
  • 85
  • 272
  • 514
  • If you want to discard your own work, try following the directions Git printed: `git checkout -- include/tools.h`. – torek Mar 29 '20 at 09:10

1 Answers1

1

To reset the last commit,

git reset HEAD~1

To reset(remove current changes) a file,

git checkout <file_name>

To reset a stagged file,

git reset <file_name>
Anurodh Singh
  • 814
  • 5
  • 9