
More on the git reset command and the similarities and differences with git checkout can be found on Pro Git, specially on the chapter Reset Demystified.Publii was originally designed to be utilized by a single user to build and maintain a static website, but additional functionalities added during the beta stages have made using Publii on multiple computers a viable option perfect if you work on your site from different machines, or have multiple authors that you want to be able to work separately on your content. If you are afraid of that just create a new temporary branch pointing to save3, so if anything happens during the process you have a backup reference.Īlso if you mess things up you can run git reflog and look for save3 in there, it should be there for a few months. DO NOT run reset with the -hard flag, as you will replace the working tree and lose any reference to save3. If you forget the -soft flag your index will be populated with the commit_1 files, but not your working tree, so you just have to add the files manually with add.

Also by leaving a branch pointing to commit_1 you can just use the branch name instead of the hash value. Now all the saves are not going to appear on the linear history. You then immediately commit, for exemple: git commit -m "commit_2" But the trick here is that your working tree and your index (staging area) still have the files from save3. Master (and HEAD) will point to commit_1.

Then you commit from different computers save1, save2 and save3 to master, pushing and pulling your work each time you change your computer. Say you have in a branch master a commit_1.

You can also use the git reset command to "erase" all "unfinished" commits that you don't wish to appear in history.
