当前位置:网站首页>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
边栏推荐
- Launpad | 基础知识
- Turn: excellent managers focus not on mistakes, but on advantages
- A subclass must use the super keyword to call the methods of its parent class
- Basic discipline formula and unit conversion
- Industry depression has the advantages of industry depression
- Live in a dream, only do things you don't say
- Global and Chinese markets of thrombography hemostasis analyzer (TEG) 2022-2028: Research Report on technology, participants, trends, market size and share
- HMS core helps baby bus show high-quality children's digital content to global developers
- Awk from entry to earth (18) GAW K line manual
- [error record] no matching function for call to 'cacheflush' cacheflush();)
猜你喜欢
Explain TCP protocol in detail three handshakes and four waves
Mac platform forgets the root password of MySQL
到底什么才是DaaS数据即服务?别再被其他DaaS概念给误导了
2022-2028 research and trend analysis report on the global edible essence industry
Clion console output Chinese garbled code
GoLand environment variable configuration
At the age of 30, I changed to Hongmeng with a high salary because I did these three things
26. Delete duplicates in the ordered array (fast and slow pointer de duplication)
随机事件的关系与运算
C语言-入门-基础-语法-[主函数,头文件](二)
随机推荐
After unplugging the network cable, does the original TCP connection still exist?
Awk from entry to penetration (6) regular matching
上周热点回顾(6.27-7.3)
What is uid? What is auth? What is a verifier?
保姆级JDEC增删改查练习
AMLOGIC gsensor debugging
Educational Codeforces Round 119 (Rated for Div. 2)
Research Report on the development trend and Prospect of global and Chinese zinc antimonide market Ⓚ 2022 ~ 2027
awk从入土到入门(10)awk内置函数
China electronic grade sulfur trioxide Market Forecast and investment strategy report (2022 Edition)
微服務入門:Gateway網關
If you can quickly generate a dictionary from two lists
A subclass must use the super keyword to call the methods of its parent class
Getting started with microservices: gateway gateway
swatch
Opencv environment construction (I)
Report on research and investment prospect prediction of China's electronic grade sulfuric acid industry (2022 Edition)
Awk from entry to earth (7) conditional statements
Global and Chinese market of air fryer 2022-2028: Research Report on technology, participants, trends, market size and share
Awk from entry to earth (14) awk output redirection