Horje
git checkout previous commit HEAD Code Example
git checkout previous commit
git reset --hard HEAD~10
To rollback 10 commits back:
git checkout previous commit HEAD
git checkout <commit_id>
git checkout -b <new branch> <commit_id>
git checkout HEAD~X // x is the number of commits to go back
git checkout previous commit HEAD
# Checkout a given commit.
# Doing so will result in a `detached HEAD` which mean that the `HEAD`
# is not pointing to the latest so you will need to checkout branch
# in order to be able to update the code.
git checkout <commit-id>

# Create a new branch forked to the given commit
git checkout -b <branch name>
checkout master with previous commit
git checkout 307a5cd        # check out the commit that you want to reset to 
git checkout -b fixy        # create a branch named fixy to do the work
git merge -s ours master    # merge master's history without changing any files
git checkout master         # switch back to master
git merge fixy              # and merge in the fixed branch
git push                    # done, no need to force push!




Shell

Related
bash maximum running time Code Example bash maximum running time Code Example
docker copy file not found Code Example docker copy file not found Code Example
wsl cd into another drive Code Example wsl cd into another drive Code Example
copiar arichvos linux ssh Code Example copiar arichvos linux ssh Code Example
The file \AppData\Roaming\npm\yarn.ps1 is not digitally signed. Code Example The file \AppData\Roaming\npm\yarn.ps1 is not digitally signed. Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9