Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

TIL (again) that the newer and supposedly nicer way to “take all the files in PATH back to how they were at COMMIT, without changing any other files or commit history” is

  git restore --source=COMMIT PATH
I have learned and tried this before but still have the muscle memory of doing

  git checkout COMMIT PATH


There is a slight difference in behavior though. For restore you won't get you index (staging area) changed. Pass "--no-overlay" to checkout to get the same behavior as restore.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: