Can we backtrack multiple files simultaneously?


#1

Question

As we seen in this lesson, we can stage and commit multiple files simultaneously. Can we also backtrack on multiple files at the same time?

Answer

The answer is yes if each of the files that you would like to backtrack are in the same commit and the same branch. If this is the case, then as we see from git status, we can backtrack to the previous commit using the command

$ git checkout -- <file> ...

where the ellipses are replaced by other files which you would like to backtrack.


FAQ: How to Backtrack - more git add