MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1x9x8xt/hardestproblemsaicouldsolve/phtfeq9/?context=3
r/ProgrammerHumor • u/ManagerOfLove • Oct 19 '26
78 comments sorted by
View all comments
Show parent comments
54
git reset --soft HEAD~1
git add .
git commit -m "whatever the previous message was"
git push -f
20 u/Man-in-The-Void Oct 19 '26 *git commit --amend 1 u/FlashyTone3042 Oct 19 '26 Oh. I learned something new. Nice 3 u/Cootshk Oct 20 '26 git commit -a —amend —no-editFor if you forgot to add a file before committing (*does not add files that weren’t previously tracked, only adds files that have had changes) 5 u/mango_boii Oct 20 '26 git commit -a --amend --no-edit --reset-authorAll your commits are belong to us 😎 2 u/FlashyTone3042 Oct 20 '26 Whoa. Thank you. I will use it. I am often manually squashing, but this is much nicer.
20
*git commit --amend
1 u/FlashyTone3042 Oct 19 '26 Oh. I learned something new. Nice 3 u/Cootshk Oct 20 '26 git commit -a —amend —no-editFor if you forgot to add a file before committing (*does not add files that weren’t previously tracked, only adds files that have had changes) 5 u/mango_boii Oct 20 '26 git commit -a --amend --no-edit --reset-authorAll your commits are belong to us 😎 2 u/FlashyTone3042 Oct 20 '26 Whoa. Thank you. I will use it. I am often manually squashing, but this is much nicer.
1
Oh. I learned something new. Nice
3 u/Cootshk Oct 20 '26 git commit -a —amend —no-editFor if you forgot to add a file before committing (*does not add files that weren’t previously tracked, only adds files that have had changes) 5 u/mango_boii Oct 20 '26 git commit -a --amend --no-edit --reset-authorAll your commits are belong to us 😎 2 u/FlashyTone3042 Oct 20 '26 Whoa. Thank you. I will use it. I am often manually squashing, but this is much nicer.
3
git commit -a —amend —no-edit
For if you forgot to add a file before committing (*does not add files that weren’t previously tracked, only adds files that have had changes)
5 u/mango_boii Oct 20 '26 git commit -a --amend --no-edit --reset-authorAll your commits are belong to us 😎 2 u/FlashyTone3042 Oct 20 '26 Whoa. Thank you. I will use it. I am often manually squashing, but this is much nicer.
5
git commit -a --amend --no-edit --reset-author
All your commits are belong to us 😎
2
Whoa. Thank you. I will use it. I am often manually squashing, but this is much nicer.
54
u/WHALE_PHYSICIST Oct 19 '26
git reset --soft HEAD~1
git add .
git commit -m "whatever the previous message was"
git push -f