Git revert vs reset last N commits

Resetting, Checking Out & Reverting | Atlassian Git Tutorial is a nice guide about ways to undo some of the commits. Reset is a harder way to undo stuff that sometimes leaves no traces, Revert is a way to create a commit that undoes the last N commits, so history is preserved and that’s good.

A way to revert the last N commits is this: 1

git revert --no-commit HEAD~3..

Two dots at the end are significant:

@cardamom Those specify a range. HEAD~3.. is the same as HEAD~3..HEAD

A saga about timezones

So. I wanted to change time back to Berlin time from Ukrainian time.

Something was wrong.

~ → timedatectl status
                      Local time: Fr 2020-08-28 18:50:55 EEST
                  Universal time: Fr 2020-08-28 15:50:55 UTC
                        RTC time: Fr 2020-08-28 15:50:55
                       Time zone: Europe/Berlin (EEST, +0300)
       System clock synchronized: yes
systemd-timesyncd.service active: yes
                 RTC in local TZ: no

UTC is right, time zone is right, but local time is wrong.

Then I google and see that Europe/Berlin is actually EEST, +0200!

Then I realize the following:

Last time I needed to change the time, I changed the timezone, by doing:

sudo cp /usr/share/zoneinfo/Europe/Kiev /etc/localtime

(#Kyivnotkiev)

/etc/localtime was a SYMBOLIC LINK to /usr/share/zoneinfo/Europe/Berlin

~ → file /etc/localtime
/etc/localtime: symbolic link to ../usr/share/zoneinfo/Europe/Berlin

By doing that, I rewrote the Berlin timezone by making it Kyiv, changing the time on my computer and changing the Berlin timezone itself.

Fixed this with a bandaid by making my timezone Europe/Rome, as /usr/share/zoneinfo/Europe/Rome was never overwritten.

↑130 ~ → timedatectl status
                      Local time: Fr 2020-08-28 17:59:15 CEST
                  Universal time: Fr 2020-08-28 15:59:15 UTC
                        RTC time: Fr 2020-08-28 15:59:15
                       Time zone: Europe/Rome (CEST, +0200)
       System clock synchronized: yes
systemd-timesyncd.service active: yes
                 RTC in local TZ: no

Happy end.