Doorgaan naar hoofdcontent

Posts

Er worden posts getoond met het label git

git partial revert

So, apparently I removed an entire directory. A long time ago in the history. But I want it back. I want it back for good. git checkout <commit id> -- <path-to-directory> Will checkout the directory nicely, thus restoring it. Also for files, etc.

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)