π
π
π
π
Git-Help
Git Cheatsheet
Searchβ¦
A Simple Git Help
Basics
Git Branching
Pull Request
Submodules
Commands
Commit changes to other branch
git log
git status
git init
Amend a commit
Reset a file or full
Undo git add
Get remote repo url
Add or Set Remote URL
Credits & Other
Other good links
Credits
Powered By
GitBook
Reset a file or full
To reset a file to the original file
To reset a file to its orginal file (remove your changes to the file abc.txt)
1
# With Git 2.23
2
git restore abc.txt
3
β
4
# With older version of git
5
git checkout -- abc.txt
Copied!
To do full reset a file (reset the file back to original remote format)
1
git checkout @ -- abc.txt
2
β
3
git checkout HEAD -- abc.txt
Copied!
Hard reset of a single file
Stack Overflow
To reset a local branch exactly to the remote
1
git fetch origin
2
git reset --hard origin/master
Copied!
Commands - Previous
Amend a commit
Next - Commands
Undo git add
Last modified
6mo ago
Copy link
Contents
To reset a local branch exactly to the remote