4 ms·
> you can only delete the human input once git branch "backup/$(git branch --show-current)/$(date +%s)" # do whatever you fancy git reset --hard "b
by lloeki 1y ago
> you can only delete the human input once
git branch "backup/$(git branch --show-current)/$(date +%s)"
# do whatever you fancy
git reset --hard "backup/$(git branch --show-current)/${thattimestampabove}"
You can't lose anything as long as you have a pointer to it (which doubles as making it easy to find)
- globular-toast 1y agoNo need to make a "backup" branch. Learn to trust the reflog.
- deleted 1y ago[deleted]
- lemonlearnings 1y agoThat is like learn to trust the indestructibility of matter. I can still lose (not able to locate...) my keys even though they still exist!
- lloeki 1y agoreflog doesn't keep things through gc. the only thing that does keep a git object is having a ref that (directly or transitively) points to it