Doorgaan naar hoofdcontent

Posts

Posts uit oktober, 2014 tonen

Git undo commit

As always, I commit way too quickly to my local repository, and then automatically push it, only to find out that i've done it wrong... There are two commands to know: git reset --hard [commit id] Returns your local repository to the specified commit id (assuming you're using the current branch) git push [repository] +[commit id]:[branchname] Returns the remote repository to the commit id. When executing both, you both reset the remote, and local repository to the specified commit... as if the rest never happened (well, it's there, but you don't see it... that's a different story)