Recent Changes - Search:

Basics

Languages

Tools

OS

Resources

PmWiki

pmwiki.org

edit SideBar

Git /

Reset

Reset allows you to change the location of the HEAD on a given branch.

This is most useful to go back to a previous commit and essentially discarding the changes that followed it.

You can reset to any previous commit by using

git reset CommitHash

where to CommitHash is the hash as seen when using log.

You can also reset to commits using a "distance", where instead of providing CommitHash, you use the current HEAD as a reference. For example, Head~1 will reset to the previous commit, Head~2 will go two commits back, etc.

Options

--hard
Also reset the working directory to the new reference point
Edit - History - Print - Recent Changes - Search
Page last modified on January 18, 2018, at 04:47 PM