DEV Community

Discussion on: What is your favourite Git command?

alexanderalemayhu profile image
Alexander Alemayhu

Amend is nice, I do it a lot on a daily basis.

git revert

For some unknown reason running git revert feels good to me 😄 It will basically undo what was done for the commit(s) specified.

I use it for removing buggy features right before a deployment or just broken code that was accidentally added. For this to work you would need to commit often and group features into their own commits.

Another weird use case is resetting a file. For ex. in one community repository I have a file called upcoming. When an event is upcoming that file is updated and when a event is over the update is reverted so the upcoming file reverts back to the placeholder text There are currently no events planned.... I might be abusing this command but it works for me 😄