How do I discard changes for a file in Git Gui?

自闭症网瘾萝莉.ら 提交于 2019-12-03 04:48:05
ThanksForAllTheFish

I know this way:

  1. The changes must be unstaged
  2. Go to Tools -> Add
  3. Choose whatever name you'd like for your command, then in Command write
    git checkout $REVISION -- $FILENAME
  4. Select (left-click) the file you want to checkout, without staging
  5. Choose from Tools the command you just created

The chosen file will be checked out to HEAD revision

I had a same problem. Just found it out: CTRL+J or Commit - Revert Changes

Siddarth Kanted
  1. Select the file from the file list in the left sidebar.
  2. In the Menu bar, under Commit, Click "Revert Changes" in the dropdown list.

Alternatively, you can use the keyboard shortcut Ctrl+J to trigger the same action on Windows.

Select the file you want to reset from the "Unstaged changes window". Then click Menù - Branch - Reset -

You will have the file before the changes you did as the last commit.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!