Git reset: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 2: Line 2:


* [[Git_Commands#Local_Repository_Manipulation|Git Commands]]
* [[Git_Commands#Local_Repository_Manipulation|Git Commands]]
=Overview=
<tt>git reset</tt> resets the current working state to the last commit, or the specified commit.
git reset ''file-name''


=Discard All Local Changes=
=Discard All Local Changes=

Revision as of 16:36, 12 August 2019

Internal

Overview

git reset resets the current working state to the last commit, or the specified commit.

git reset file-name

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.

Other Use Cases