Git reset: Difference between revisions
Jump to navigation
Jump to search
Line 2: | Line 2: | ||
* [[Git_Commands#Local_Repository_Manipulation|Git Commands]] | * [[Git_Commands#Local_Repository_Manipulation|Git Commands]] | ||
=Discard All Local Changes= | |||
git reset --hard HEAD | |||
Resets the index and the working tree to the specified commit, by discarding all local changes to the tracked files. | |||
=<span id='Use_Cases'></span>Other Use Cases= | =<span id='Use_Cases'></span>Other Use Cases= | ||
* [[Git_Problems#Local_and_Remote_Origin_Branches_Have_Diverged_without_Activity_on_Local_Branch|Local and remote origin branches have diverged without activity on the local branch]]. | * [[Git_Problems#Local_and_Remote_Origin_Branches_Have_Diverged_without_Activity_on_Local_Branch|Local and remote origin branches have diverged without activity on the local branch]]. |
Revision as of 00:45, 30 July 2019
Internal
Discard All Local Changes
git reset --hard HEAD
Resets the index and the working tree to the specified commit, by discarding all local changes to the tracked files.