Edit the last thing you committed to git
- Originally Posted:
- 26 May 2021
I use this all the time, it's perfect for when you commit, then realise you need to change one small part of your code.
Make your changes and
add them, next run
commit with the
--amend flag and it will update your last commit with the changes you just added!
git add --patchgit commit --amend
Warning: Never amend commits that have been pushed to a shared branch as it can cause issues if someone has already pulled the original commit.