git selective revert local changes from a file

前端 未结 6 987
花落未央
花落未央 2021-01-29 18:55

In my git repo which is tracking a svn repo I have made a number of edits to a single file.

Now I want to revert those changes(like svn revert), but only portions of the

6条回答
  •  你的背包
    2021-01-29 19:16

    The command line options described in the answers here are handy when the file is on a server which I am accessing via a ssh terminal. However, when the file is on my local machine I prefer the following way:

    Open the file in the netbeans editor (which comes with git support). Netbeans puts red/green/blue marks at line numbers to indicate where stuff was deleted/added/modified (respectively).

    Right clicking any of these marks gives you an option to undo that change. In addition, you can right click on red and blue marks to find see the old version in a popup.

提交回复
热议问题