From a9d46b3ccd1638d4c85e7f63cf99fc5150df4ff0 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Fri, 24 May 2024 19:24:53 +0100 Subject: [PATCH] Add daily email for 2024-05-22 `git revert` is your friend --- source/_daily_emails/2024-05-22.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 source/_daily_emails/2024-05-22.md diff --git a/source/_daily_emails/2024-05-22.md b/source/_daily_emails/2024-05-22.md new file mode 100644 index 000000000..380dd4b24 --- /dev/null +++ b/source/_daily_emails/2024-05-22.md @@ -0,0 +1,29 @@ +--- +title: '`git revert` is your friend' +date: 2024-05-22 +permalink: daily/2024/05/22/git-revert-is-your-friend +tags: + - software-development + - git +cta: ~ +snippet: | + `git revert` is your friend. +--- + +Imagine you've made a commit and want to undo it, or a particular commit is causing issues in production and you want to roll it back. + +Instead of having to change it back manually, `git revert` can do it for you. + +You specify the commit SHA you want to revert and Git will automatically try and revert that commit. + +It creates its own commit message which includes the original commit message and [the reverted commit SHA][0], so you can easily find or navigate to the original commit. + +For example: + +> Revert "Sort talks only by the event date" +> +> This reverts commit cbd1417b24a608df8b451a3ab5c9f888de41e758. + +Next time, instead of manually reverting a commit, give `git revert` a try. + +[0]: {{site.url}}/daily/2024/05/20/referencing-other-commits-in-commit-messages