Here is all the need:
I have a remote branch (fix branch) called /fix/version-1.x which have two commits:
- First commit done by user A
- Second commit by user B (Me)
It turned out that this branch is not correct (more precisely my second commit) : there was some implementation error on one file
As first step :
1- I have downloaded this branch (with the two commit)
so as first reaction i made a simple checkout for this file to the previous commit (the first one) as there was no implementation error there .
2- I checked out the first commit (only for this file)
git checkout 'commit' file/to/restore
3- I got a 'detached HEAD'
with git branch command
4- I made the cahnge for this file (correction)
5- git add file/to/restore
6- git status OK
7- I made a commit with a new msg git commit -m "solve implementation error problem"
when I push my local branch to the remote server
8- git push remote fix/version-1.x
It tell me that there is every thing is up to date (already updated) nothing to do !!!
but when I'm working without checking out the file to the previous state (the fist commit), ie i made the change directly on this branch and made a commit then push to the remote server every thing is working correctly and i have the new commit (third one ) on the remote server.
It seems that the problem comes from this detached head ? I 'm doing wrong here ?