reset branch on local git
git fetch origin
git reset --hard origin/master
git reset hard
$ git reset --hard HEAD       (going back to HEAD)

$ git reset --hard HEAD^      (going back to the commit before HEAD)
$ git reset --hard HEAD~1     (equivalent to "^")

$ git reset --hard HEAD~2     (going back two commits before HEAD)
git reset
git reset --soft HEAD~3
git commit
git push —force-with-lease origin
git reset hard
git reset --hard f414f31
git reset --soft HEAD@{1}
git commit -m "Reverting to the state of the project at f414f31"
undo git reset hard
$ git init
Initialized empty Git repository in .git/

$ echo "testing reset" > file1
$ git add file1
$ git commit -m 'added file1'
Created initial commit 1a75c1d: added file1
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 file1

$ echo "added new file" > file2
$ git add file2
$ git commit -m 'added file2'
Created commit f6e5064: added file2
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 file2

$ git reset --hard HEAD^
HEAD is now at 1a75c1d... added file1

$ cat file2
cat: file2: No such file or directory

$ git reflog
1a75c1d... HEAD@{0}: reset --hard HEAD^: updating HEAD
f6e5064... HEAD@{1}: commit: added file2

$ git reset --hard f6e5064
HEAD is now at f6e5064... added file2

$ cat file2
added new file
reset hard git
git reset notreCommitCible --hard

Shell/Bash相关代码片段

STEAM LINUX APEX NOT WORKING

unrar password protected rar file

alias pip to pip3

zsh compinit

linux check docker daemon running

git how to uncommit a commit --amend

remove containers with images and volumns

tauri cargo

can you upgrade the ram in msi p65 creator

ubuntu ssh add private keys

ssh-copy-id proxy jump

postgresql shell

powershell allow port 27017 udp tcp

ufw allow from interface

mac compress folder

shell escape

bash scripting cheat sheet

how to install prisma

uploadthing install

docker pull stuck on waiting

golang nodemon

powershell alias for git

winetricks.sh

gnome software not showing nvidia

sed remove lines between matches

cannot install dotenv python

Download ProtonVPN Fedora

give file execute permission mac

git diff show only changed lines

WINE keyrings setup

install opencv runtime only on linux ubutnu

Wine PGP key setup

smartctl fedora install

linux reload sysctl.conf

npm install formidable

docker build print logs

kill connection using process id

connections to port netstat command windows

linux adapter command

see existing users linux

resolv.conf search

nativefier ubuntu

ubuntu dart sdk path flutter

kubernetes ssh into pod

pass variable from one script to another bash

rm nvidia driver linux ubuntu

ngrok for ubuntu

where are pip packages installed

git authen failed

bun list global packages

ubuntu os update login black screen

adb packages path

windows command create file

swithc pphh versoij ubuntu

apache2 installation missing files

uninstall simple screen recorder

insteall .deb

cpptraj rmsd each traj

kill all dockers

upgrade to rustc 1.70.0

ubuntu search process by pid

Shell/cURL POST request example

grep word not line

how to uninstall nvm itself ubuntu

parameterized function in shell script

windows 10 symbolic link folde

zustand redux

open terminal in any folder in finder

install lamp stack ubuntu 20.04

how to make start docker desktop as root

ubuntu font reset

ubuntu copy fiolder

open wsl shell in current folder

clang++ ubuntu

remixicon install

docker compose v2 install ubuntu

pg add citext

postgres add citext

git for default branch change

ubuntu container exited after run in docker