Reset

Resetting a working copy is something that should not be done lightly. It will reset your HEAD pointer, which keeps track of the commit your repository is currently at. By default, your working tree is preserved, so all unstaged changes are kept as they are, and the HEAD pointer is reset to a specific commit. This means that you can commit your changes on top of the commit that you reset to, while all other commits will be discarded:

# Reset the repository to the commit before our changes
git log

git reset 23e16ac822dab6f7674608b58fe46a7b9bf038b8 --hard

# Git log now only shows commits up until the commit you reset HEAD to
git log

A hard reset will also reset your working tree, in addition to resetting your HEAD pointer. A soft reset will place your changes in your working tree.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.86.134