3 ms·
git reset --hard does not only modify the work tree though, it also updates where your current branch points to. In fact, that is the main purpose of ‘git reset
by gpanders 5y ago
git reset --hard does not only modify the work tree though, it also updates where your current branch points to. In fact, that is the main purpose of ‘git reset’, the fact that it modified your work tree at all is only because of the ‘--hard’ flag. So it’s not correct to say that “reset --hard and checkout do basically the same thing”.
- aidenn0 5y agogit reset --hard HEAD Does in fact only modify the work tree, since updating the current branch to HEAD is a nop.