Custom Search

Wednesday, November 6, 2013

How to git revert local changes of single file

1)
Method-1
#git status
#git checkout filename
#git status

2)
Method-2 
a)
remove all changes (local changes) from HEAD and save them somewhere else
#git stash

b)
Do something like update repository(git pull), change branch and update, et--
 
c)
restore all changes again
#git stash pop



No comments:

Post a Comment