git 回滚指定行

Stage the parts you want with git add -p, then discard (git checkout -- filename) the unstaged changes.

Update for Git 1.6.5+

In version 1.6.5, Git learned to checkout with a -p/--patch flag. You can discard chunks in one step with git checkout -p -- filename.

 

 

git checkout -p -- filename

能够按区块进行回滚工作区。

posted @ 2018-09-05 20:33  澄轶  阅读(300)  评论(0编辑  收藏  举报