Loading tutorials
git init or git clone, git add, git commit, git status, and git log in a terminal. You should know what a branch is and that a remote repository is a copy of the project stored elsewhere. Later chapters build on the model described here.3 min readgit init, git add, git commit, git status, and git log. It also assumes you know that a branch is a named pointer to a commit. Every undo command in the chapters ahead works on one or more of the three areas described here, so this model is the foundation f3 min readgit add, git commit, git status and git log, and that you know what a branch is. You should also be comfortable running commands in a terminal.3 min readgit add, git commit, git status, and the three areas from the previous chapter: the working tree, the index (also called the staging area), and HEAD. Here you will remove files from the index while keeping your edits on disk.3 min readgit status, git add, and git commit, and that you know the working tree and index are separate areas. git restore handles files Git already tracks. It does nothing for files Git has never seen. git clean handles those.3 min readadd, commit, status, and log. It also assumes you know the three areas: the working tree, the index, and HEAD. The goal is to bring back one file as it looked in an older commit, without moving your branch.2 min readgit log. It also assumes you know that the index (the staging area) holds the snapshot for your next commit, and that HEAD points to the current commit on your branch.3 min readgit log and git status. It also assumes you know the three areas: the working tree (your files), the index (the staging area), and HEAD (the commit your branch points to).3 min readgit log, and that you know a branch is a pointer to a commit. It also assumes you have read the earlier chapters on the three areas and on git reset.3 min readHEAD and a branch pointer are. It explains why some undo commands are safe on shared branches and others are not.3 min readgit log. It also assumes you know that git reset --hard moves a branch and rewrites your index and working tree. You should know the three areas from earlier chapters: working tree, index, and HEAD.3 min readgit revert works on an ordinary commit and what a merge commit is. It covers the extra step Git needs when the commit you want to undo is a merge.3 min readgit reset, git commit --amend, and git reflog work, and that you understand why rewriting shared history is risky. Interactive rebase extends --amend to commits further back than the latest one. It rewrites several local commits in one pass.3 min read