I have used Git to view some older files using the git checkout <hash>
command.
However, now I want to move the head back to the latest commit without saving the changes I did at the older files.
Could you help on how to do that?
I have used Git to view some older files using the git checkout <hash>
command.
However, now I want to move the head back to the latest commit without saving the changes I did at the older files.
Could you help on how to do that?
You did not explain you needs, so I am trying to guess...
Try with:
git reset --soft HEAD~1
# or
git reset --soft <COMMIT_ID>
Rembember --soft
leave changes as uncommitted in order to inspect without loosing them.
Replace it with --hard
if you need to discard them.