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

What would "update" actually do?

For history, "git log", that is "git log file".

Isn't part three the same as "git checkout HEAD~1 -- file" ?




>What would "update" actually do?

git add . && git commit && git push

>Isn't part three the same as "git checkout HEAD~1 -- file" ?

What if the delete took place three commits ago?


> What if the delete took place three commits ago?

The original command he was suggesting a replacement for used `-n 1`, so it seems kind of silly to point this out to him.


Ah okay. I can see that.

Then you use HEAD~3.


But you first have to find in which commit you deleted the file.


Ah ha, we're starting from different assumptions. Makes sense now, thank you!


As soon as a command requires stuff as "HEAD" and "~" I believe there should be an easier way.




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

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

Search: