IntelliJ IDEA 2017.1 Help

Reset Head Dialog

VCS | Git | Reset Head

Use this dialog box to specify the commit you want to reset the current HEAD to and define the reset method.

Git RootIn this drop-down list, select the path to the local repository in which you want to reset the HEAD of a branch.
Current BranchThis read-only field shows the name of the branch which is currently checked out in the selected local repository.

The contents of the field depend on the selection in the Git Root drop-down list.

Reset TypeUse this drop-down list to define the reset method to use. The available options are:
  • Mixed - the default strategy. When this option is selected, the index is reset while the working tree is not, which means that changed files are preserved but not marked for commit. You are presented with a report of what has not been updated.
  • Soft - when this option is selected, the index and the working tree are not affected, only the HEAD pointer is moved to the specified commit. Your current state with any changes remains different from the commit you are switching to. All the changes are "staged" for committing.
  • Hard - when this option is selected, both the working directory and the index are changed to the specified commit.
To CommitIn this text box, specify the commit you want to reset the current HEAD to. Type the desired commit hash or use an expression, for example, of the following structure:

<branch>~<number of commits backwards between the current HEAD and the required commit> .

Refer to the Git commit naming conventions for details.

ValidateClick this button to check that the commit specified in the To Commit field exists and view which files were affected in it.
ResetClick this button to initiate resetting the HEAD to the specified commit accotding to the defined method.

See Also

Last modified: 18 July 2017