In this post let’s see different ways of resetting a file to a particular revision.
git checkout <commit_hash_id> -- <file_path> Example
git checkout cc1d4a7 -- example.py
I think the above command is very self-explanatory.
You are reverting a file to a particular commit. In other words, git will take the mentioned file and apply the mentioned commit changes to it.
You can mention multiple files to revert too.
git checkout cc1d4a7 -- example.py index.py
git restore --source <commit_hash_id> <file_path> Example
git restore --source cc1d4a7 index.py
We have seen restore in our previous edition. …
Github CLI is one of the useful tools you can start using right away if you are a very active Github user.
You can visit the repo here.
This is still in beta but you can still use it. It brings PRs, issues, and other useful features of Github to the command line.
I will cover some commands that I find very useful. And you can also play around with the tool.
You can list all the PRs of the repo.
There are options for filtering PRs with the assignee, base branch, labels.
gh pr list --label "WIP, help" // List PRs with the provided…
Forgit is a lightweight CLI tool that helps you to use Git interactively. This tool is a very useful tool that helps you to work effectively.
This tool uses
fzf. So don't forget to download it.
To install fzf, follow
these instructions for your respective platforms.
To install Forgit,
Some of the useful commands in Forgit
The default command is ga
In the above image, you can see the interactive screen.
You can use
arrow keys to navigate up and down.
The default command is glo
As the tool uses fzf, you can fuzzy search the logs.
The default command is…