PyCharm 3.1.0 Web Help

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.

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

Note

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

Reset Type Use 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 Commit In 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.

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

See Also

Procedures:

Web Resources: