当前位置:网站首页>How does idea withdraw code from remote push
How does idea withdraw code from remote push
2022-07-04 09:14:00 【The fruit of it midsummer】
In normal development , We often commit some wrong code to the remote branch by hand , At this time, we want to withdraw quickly to avoid unnecessary problems caused by the error code being pulled by colleagues , Today we will demonstrate :
First of all, this is the code in my remote warehouse :

My local code :

operation : Hand error twice in a row ( First submission and second submission ) Submit the local error code to the remote warehouse
git Submit the record :(nio It's actually my first time to submit information. I mistakenly wrote it here , But it doesn't affect )

Local code records :
Remote warehouse records :

At this time, mistakes have been made , I have submitted the wrong code to the remote branch twice by hand , So how can I withdraw ?

At this time, find the submission you want to withdraw to , Right click to select (Reset Current Branch to Here). such as : I want the code to roll back to what it looked like when I first submitted , Just find my first submission nio Right click to select Reset Current Branch to Here Click to select the second one Mixed Click ok

At this time, you will find that your local code is still the same as before , But it shows no commit The state of .

Find your local change record at this time ( Is our usual code commit The box that pops out when )

Click on this. " Arrow returned " Roll back
Click on Rollback after , Our code will return to the way we first submitted .

But at this time, it is only local restore , The previously submitted error code is still on the remote . So we need to cover the code to the remote .
Because the previous operations are first update>>>>>push, But in our case , Will pull down the remote error code , Then our previous operations are in vain , So it needs to be enforced push. Although we didn't submit information at this time , But we can still choose to force push.

Be careful : At this time, I found idea mandatory push Button gray , So I changed it to command line coercion push.
git push origin HEAD --force

Finally, it is found that the remote code has been successfully overwritten 
边栏推荐
- How to pass custom object via intent in kotlin
- C language - Introduction - Foundation - syntax - [main function, header file] (II)
- Codeforces Round #793 (Div. 2)(A-D)
- Educational Codeforces Round 115 (Rated for Div. 2)
- 到底什么才是DaaS数据即服务?别再被其他DaaS概念给误导了
- Ehrlich sieve + Euler sieve + interval sieve
- Launchpad x | mode
- What is permission? What is a role? What are users?
- Codeforces Round #803 (Div. 2)(A-D)
- Awk from entry to earth (7) conditional statements
猜你喜欢

2022-2028 global visual quality analyzer industry research and trend analysis report

Jianzhi offer 09 realizes queue with two stacks

How do microservices aggregate API documents? This wave of show~
](/img/3f/4d8f4c77d9fde5dd3f53ef890ecfa8.png)
C语言-入门-基础-语法-[运算符,类型转换](六)
](/img/89/0f5f4ba07c637b09abe873016cba2d.png)
C语言-入门-基础-语法-[标识符,关键字,分号,空格,注释,输入和输出](三)

ArrayBuffer
![C language - Introduction - Foundation - syntax - [main function, header file] (II)](/img/5a/c6a3c5cd8038d17c5b0ead2ad52764.png)
C language - Introduction - Foundation - syntax - [main function, header file] (II)

Target detection -- intensive reading of yolov3 paper

What exactly is DAAS data as a service? Don't be misled by other DAAS concepts

Clion console output Chinese garbled code
随机推荐
C语言-入门-基础-语法-数据类型(四)
In depth investigation and Strategic Research Report on China's motion controller Market (2022 Edition)
Reading notes on how to connect the network - hubs, routers and routers (III)
Research and investment strategy report of China's electronic hydrogen peroxide industry (2022 Edition)
What exactly is DAAS data as a service? Don't be misled by other DAAS concepts
Implementation principle of redis string and sorted set
Explain TCP protocol in detail three handshakes and four waves
《网络是怎么样连接的》读书笔记 - FTTH
Awk from entry to earth (15) awk executes external commands
上周热点回顾(6.27-7.3)
LinkedList in the list set is stored in order
老掉牙的 synchronized 锁优化,一次给你讲清楚!
The map set type is stored in the form of key value pairs, and the iterative traversal is faster than the list set
Awk from getting started to digging in (9) circular statement
【LeetCode 42】501. Mode in binary search tree
Awk from entry to earth (14) awk output redirection
China battery grade manganese sulfate Market Forecast and strategic consulting report (2022 Edition)
Global and Chinese markets of thrombography hemostasis analyzer (TEG) 2022-2028: Research Report on technology, participants, trends, market size and share
At the age of 30, I changed to Hongmeng with a high salary because I did these three things
Report on investment analysis and prospect trend prediction of China's MOCVD industry Ⓤ 2022 ~ 2028