✅ Week 03 Lecture Solutions
Tracing the changes I’ve made live during the W03 lecture
Last Updated: 03 February 2025, 15:42.
Hi everyone, here’s a short video that will guide you on how to use more advanced git commands to retrace all the steps I’ve made during the 🗣️ W03 Lecture in the morning.
Summary of git commands
Here are the commands I used:
Check the log of commits
git log --oneline --graphTo see a tree-like storyline of the commits made from the beginning of the history of the repository up until where I am now.
You can also specify particular branches of interest:
git log --oneline --graph --branches HEAD origin/main feature*Go back in time
Use the following command to go back to a specific commit:
git reset --hard <commit-hash>This command will remove all the commits and all files that were added after the commit with the hash <commit-hash>. Be careful with this command, as it is irreversible.
Update your references
The git fetch command does not change your working directory or staging area. It only updates the pointers to the remote repository.
git fetch --all