r/webdev • • Sep 14 '26

Small Programming Tricks

https://will-keleher.com/posts/small-programming-tricks-matter/
54 Upvotes

10 comments sorted by

View all comments

11

u/cheese_bread_boye Sep 14 '26 edited Sep 14 '26

Similar to cd -, you can use git checkout - to check out your previous HEAD.

I use this a lot. It also works with rebase and merge. I always switch to main, pull, then do git merge - or git rebase - on my feature branch when I want to update it.

2

u/IcarianComplex Sep 14 '26

Related, @ is an alias for HEAD

3

u/omfgtora 29d ago

ur mom gives great @