DEV Community

Discussion on: Confused by git? Here's a git crash course to fix that 🎉

 
chrisachard profile image
Chris Achard

If you want to change a remote commit, you'll have to do this, and then push with -f (which is a force push).

HOWEVER! Be careful with force push. If you accidentally force push to the wrong branch, then it can really mess you up, and if you have teammates who have already downloaded a public branch (like master), then force pushing to master isn't a good idea.

If you've already pushed to a public branch, the better choice is probably to just make a new commit.

Thread Thread
 
m_starca profile image
marko

I will keep that in mind. Thank you.