Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The reset command does a lot of diferent things. The most basic form is as follows:

Code Block

git reset FILE1

This . It will replace the file in your working directory with the lasted one in your HEAD.

Code Block

git reset FILE1

An optional second parameter is the commit from which to pull the file. And since branches are just named commits, you can use a branch name as well

...

Reflog is the command to see all changes to branch pointers. This will include commits, resets, etc.

The Reflog can really save you if you accidently reset or rebase a branch (losing commits), or even delete a branch. Just locate the commit you know was the last in the deleted branch and issue the command to create another branch from it

...