Hacker News new | past | comments | ask | show | jobs | submit login

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.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: