Resetting Branch Head to a Selected Commit
PhpStorm allows you to reset the current Git branch head to a selected commit and update the working tree and the index.
To reset the current branch head to a selected commit
- In the main menu navigate to View | Tool Windows | Changes.
- In the Version Control tool window switch to the Log tab.
- Select a commit that you want to reset the current branch head to, and right-click this commit. Select Reset Current Branch to Here from the popup menu.
- In the Git Reset dialog that opens, select the mode for updating the working tree and the index. The following options are available:
- Soft: The modified files will not be changed, and the differences will be staged for commit.
- Mixed: The modified files will not be changed, and the differences will be unstaged. This mode is used by default and is identical to the
git reset
command. - Hard: The modified files will be reverted to the selected commit, and all uncommited changes will be lost.
- Keep: The modified files will be reverted to the selected commit, but local changes will be preserved.
See Also
Reference:
Last modified: 19 July 2017