Recovering Deleted commits
- Git has two types of logs
- log
- ref-log: This is a permanent log but available only in .git folder
- Watch classroom video for steps
Detached Head
- Detached Head refers to a state where HEAD is pointed towards a commit rather than a branch.
- We can use this for verifying changes but never start committing changes in this case, as changes might be lost.
- Best Practice: If you want to work on the older commit,
- checkout to that commit
- create a branch from there
git switch -c "<branch-name>" - Now make changes in this branch
- if the changes are required any where else use merge or cherry-pick.
Remote
- Git remote is another repo which is ideally containing the same code as yours.
- Git Remote can be hosted
- locally on your system for local usage (This doesnot make sense)
- Organizations hosting git on servers owned by them (Self Hosted Git)
- Gitolite
- Gerrit (Hosting + Code Reviews)
- Gitlab Self Hosted Version
- GitHub Enterprise (SelfHosted)
- Cloud Hosted Git Remotes
- GitHub
- Azure Source Repos
- AWS Code Commit
- Atlassian Bit Bucket
- GitLab
Fourth Area of Git
- Remote Repo

Terms
- Clone: When you donot have local copy of the repo and want it on your system you perform clone
- pull: to get the latest commits into your local repo (need to dive more)
- push: to send the commits from your local repo to remote repo
- Every remote repo has a url and a name.
originis the default remote repo name.
Lets create a repo in github
- In github we can create public repos or private repos.
- Let me create a public repo

Lets clone a repo
- Let clone
git clone repo-url

- lets cd into folder and execute git commands

- Lets create a commit and push the changes
